Skip to content

Instantly share code, notes, and snippets.

🐹
Dabbling with Golang

Thibault Maekelbergh thibmaek

🐹
Dabbling with Golang
Block or report user

Report or block thibmaek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thibmaek
thibmaek / parse.sh
Created Apr 10, 2019
InfluxDB: parse shell string fields
View parse.sh
payload=""
fields=("d=2" "f=3")
for field in "${fields[@]}"; do
key=$(echo "$field" | sed 's/=.*//g')
value=$(echo $field | awk -F= '{print $2}')
echo $key
echo $value
payload="$payload $key=\"$value\""
@thibmaek
thibmaek / vrt_loop_download_season.sh
Last active Mar 11, 2019
Download season from VRTNU
View vrt_loop_download_season.sh
# Example to download every episode from VRTNU (A-Z Luc Tuymans)
function main() {
local episodes=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26)
for ep in "${episodes[@]}"; do
youtube-dl "https://www.vrt.be/vrtnu/a-z/van-a-tot-z--luc-tuymans/2019/van-a-tot-z--luc-tuymans-s2019a$ep/"
done
unset episodes
}
@thibmaek
thibmaek / npm.js
Created Aug 2, 2018
NPM on the web
View npm.js
const npm = pkg => import(`https://unpkg.com/${pkg}?module`);
(async () => {
const pf = await npm('pure-fun');
})();
@thibmaek
thibmaek / deploy-expo-ios.sh
Created Jun 21, 2018
CD for Expo RN applications
View deploy-expo-ios.sh
#! /usr/bin/env bash
set -e
# This is based on the expo blogpost:
# https://blog.expo.io/automating-standalone-expo-app-builds-and-deployments-with-fastlane-exp-and-exptool-9b2f5ad0a2cd
# Publish `production` release to Expo
function publish_expo() {
# Log into Expo when running in CI
# Locally you should already be logged in
@thibmaek
thibmaek / rf_simple_receive.ino
Created May 21, 2018
RF Simple receive (Arduino)
View rf_simple_receive.ino
/*
Simple example for receiving
https://github.com/sui77/rc-switch/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
@thibmaek
thibmaek / Shortcuts.json
Created Oct 21, 2017
Spectacle shortcuts
View Shortcuts.json
[
{
"shortcut_key_binding" : null,
"shortcut_name" : "RedoLastMove"
},
{
"shortcut_key_binding" : "ctrl+alt+cmd+=",
"shortcut_name" : "MakeSmaller"
},
{
@thibmaek
thibmaek / get_node_engine.sh
Created Mar 28, 2017
Get node engine from package.json
View get_node_engine.sh
# 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
View 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 Oct 21, 2017
Powerline Shell config
View .powerline-shell.json
{
"segments": [
"ssh",
"cwd",
"read_only",
"git",
"jobs",
"exit_code",
"root",
"newline"
@thibmaek
thibmaek / nvmi.sh
Last active Jun 22, 2017
Update node with nvm, migrating global modules
View nvmi.sh
# 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
You can’t perform that action at this time.