Skip to content

Instantly share code, notes, and snippets.

View thibmaek's full-sized avatar
🐹
Currently coding a lot in Go

Thibault Maekelbergh thibmaek

🐹
Currently coding a lot in Go
View GitHub Profile
@thibmaek
thibmaek / HTTPServer.command
Last active August 29, 2015 14:11
HTTP Server with error check
### Thibault Maekelbergh ###
### http://blog.thibmaekelbergh.be/2014/12/18/http-python-server.html ###
cd "$(dirname "$0")" #Get current directory
ENTRY=index.html #Set the entry point for the server
if [ -f "$ENTRY" ]; then #Check if the entry exists then go on
sleep 1 && open "http://localhost:8000/"; #Delay a second then open localhost
python -m SimpleHTTPServer; #Start the HTTP Server
@thibmaek
thibmaek / Soundcloud Artwork Grabber.js
Last active August 29, 2015 14:18
Soundcloud Artwork Grabber
javascript:void((function(){var%20e=document.querySelectorAll(".image__full");p=e[1].style.backgroundImage;f=p.substr(4,63);window.location=f;})())
@thibmaek
thibmaek / get_node_engine.sh
Created March 28, 2017 09:20
Get node engine from package.json
# Given engine.node = 6.10.1 in package.json
# will output 6.10.1 in the shell
cat package.json | grep \"node\": | grep -E -o '(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)'
# Why? Auto install package.json version to nvm
cat package.json | grep \"node\": | grep -E -o '(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)' | nvm install
@thibmaek
thibmaek / nvmi.sh
Last active June 22, 2017 22:49
Update node with nvm, migrating global modules
# Usage: nvmi v6.0.1 (will install specified version)
# Usage: nvmi_latest (will install latest node version)
# these functions will replace the current 'default' version known in the shell.
# to install a node version next to your current 'default' just use nvm install vX.X.X
function nvmi() {
CURRENT=$(node -v)
nvm install $1 --reinstall-packages-from=$CURRENT
@thibmaek
thibmaek / keybase.md
Last active September 25, 2017 20:45
keybase.md

Keybase proof

I hereby claim:

  • I am thibmaek on github.
  • I am thibmaek (https://keybase.io/thibmaek) on keybase.
  • I have a public key ASA2HCof3XCCjQiWBifGModqhxtnGhXgqlbKagrGc4Sncwo

To claim this, I am signing this object:

@thibmaek
thibmaek / .powerline-shell.json
Last active October 21, 2017 23:31
Powerline Shell config
{
"segments": [
"ssh",
"cwd",
"read_only",
"git",
"jobs",
"exit_code",
"root",
"newline"
@thibmaek
thibmaek / Shortcuts.json
Created October 21, 2017 23:48
Spectacle shortcuts
[
{
"shortcut_key_binding" : null,
"shortcut_name" : "RedoLastMove"
},
{
"shortcut_key_binding" : "ctrl+alt+cmd+=",
"shortcut_name" : "MakeSmaller"
},
{
@thibmaek
thibmaek / rf_simple_receive.ino
Created May 21, 2018 17:14
RF Simple receive (Arduino)
/*
Simple example for receiving
https://github.com/sui77/rc-switch/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
@thibmaek
thibmaek / npm.js
Created August 2, 2018 15:00
NPM on the web
const npm = pkg => import(`https://unpkg.com/${pkg}?module`);
(async () => {
const pf = await npm('pure-fun');
})();
@thibmaek
thibmaek / _audio.sh
Created August 17, 2015 23:47
Convert FLAC to AAC | MP3
function _audio() {
case $1 in
--mp3|*) local CODEC=libmp3lame;local FILENAME=mp3;;
--aac) local CODEC=libvo_aacenc;local FILENAME=aac;;
esac
case $2 in
256|*) local BITRATE=256k;;
320) local BITRATE=320k;;
esac