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 / pod_install.sh
Created January 21, 2021 17:04
Agnostic pod install! Source this to pod install wherever in your project
#!/usr/bin/env bash
function find_podfile_dir() {
podFile=$(find "$PWD" -type f -not -path "*/node_modules/*" -name "Podfile")
if [ -f "$podFile" ]; then
echo "${podFile//Podfile/}"
else
echo "Unable to find Podfile"
exit 1
@thibmaek
thibmaek / parse.sh
Created April 10, 2019 13:02
InfluxDB: parse shell string fields
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 March 11, 2019 09:57
Download season from VRTNU
# 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 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 / deploy-expo-ios.sh
Created June 21, 2018 21:43
CD for Expo RN applications
#! /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 17:14
RF Simple receive (Arduino)
/*
Simple example for receiving
https://github.com/sui77/rc-switch/
*/
#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
@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 / 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 / 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"