Skip to content

Instantly share code, notes, and snippets.

@funkyremi
funkyremi / music
Last active January 20, 2017 08:40
This script lets you play music (internet radio) from you terminal.
#!/bin/bash
# This script lets you play music from you terminal.
# 1) Install mplayer
# 2) chmod +x music
# 3) Put 'music' script in a folder on your PATH.
# 4) Enjoy ;)
if [ -z $1 ]; then
echo "Usage:"
@funkyremi
funkyremi / ST3-with-iCloud-Drive.sh
Created June 19, 2017 21:10 — forked from joeshub/ST3-with-iCloud-Drive.sh
Sync your Sublime Text 3 Settings using iCloud Drive on multiple Macs
# Notes
# Using iCloud Drive, you can sync your Sublime Text 3
# plugins and prefs so you can always have the same setup
# Prerequisites
# Make sure both machines have the latest version of OSX 10.10.x with
# Yosemite or higher and iCloud Drive turned on
# Quit ST3
# Drag and drop the following code in your browser bookmarks to show current page passwords
javascript:var inputs=document.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].type.toLowerCase()==='password'){inputs[i].type='text';}}
@funkyremi
funkyremi / csv.js
Created November 30, 2018 16:23
Javascript csvToJson jsonToCsv
const jsonToCsv = (array, separator) => {
let result = '';
for (const key in array[0]) {
result.length === 0 ? result += key : result += `${separator}${key}`;
}
result += '\r\n';
array.forEach(line => {
let lineStr = '';
for (const value in line) {
lineStr.length === 0 ? lineStr += line[value] : lineStr += `${separator}${line[value]}`;

Scrap Netflix Secret Categories

  1. Copy the following URL in your web browser: https://www.whats-on-netflix.com/library/categories/
  2. Copy and paste the following code in the developer console on the previous URL.
  3. The result is in your clipboard.
function simulateClick(elem) {
	const evt = new MouseEvent('click', {
 bubbles: true,
[
{
"code": "1365",
"name": "Action & Adventure"
},
{
"code": "4082",
"name": "Action & Adventure based on a book from the 1960s"
},
{
const codes = [
{
name: 'Action & Adventure',
code: '1365',
},
{
name: 'Action Comedies',
code: '43040',
},
{
@funkyremi
funkyremi / 🎉.js
Created February 15, 2019 16:19
Auto scroll to Github best comment
// Auto scroll to Github best comment
// Choose one of the following method (Bookmark toolbar link or Browser console)
// Minified code (drag and drop to your bookmarks)
javascript:var bestCommentId;var bestScore=0;Array.from(document.querySelectorAll(".js-targetable-comment")).forEach(item=>{if(item.querySelector("button.reaction-summary-item")){let commentScore=0;Array.from(item.querySelectorAll("button.reaction-summary-item")).forEach(i=>{if(!!i.innerText){commentScore+=Number(i.innerText.replace(/\D/g,''))}});if(commentScore>bestScore){bestScore=commentScore;bestCommentId=item.id}}});console.log('Comment score',bestScore);location.href=`#${ bestCommentId }`;
// Original code (copy paste in your browser console)
var bestCommentId;
var bestScore = 0;
Array.from(document.querySelectorAll(".js-targetable-comment")).forEach(item => {
@funkyremi
funkyremi / screenshot-videos.js
Last active February 25, 2019 19:23
Capture picture from videos online
// Paste the following code in your developer console
var canvas = document.createElement('canvas');
var theVideo = document.querySelector('video');
canvas.width = theVideo.videoWidth;
canvas.height = theVideo.videoHeight;
canvas.getContext('2d').drawImage(theVideo, 0, 0, theVideo.videoWidth, theVideo.videoHeight);
var png = canvas.toDataURL('image/png');
var link = document.createElement('a');
link.href = png;
link.setAttribute('download', 'capture.png');

Update all docker images

docker images |grep -v REPOSITORY|awk '{print $1}'|xargs -L1 docker pull

Remove all containers

docker container rm $(docker ps -aq)

Remove all images

docker rmi $(docker images -aq)

See Docker Daemon logs