This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: hostname | |
# Required-Start: | |
# Required-Stop: | |
# Should-Start: glibc | |
# Default-Start: S | |
# Default-Stop: | |
# Short-Description: Set hostname based on /etc/hostname | |
# Description: Read the machines hostname from /etc/hostname, and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
json2markdowntable () { | |
local headers=$@ | |
echo $headers | sed "s, , | ,g" | |
seq $# | while read i; do echo " --- "; done | xargs | sed "s, , | ,g" | |
json -a $headers -d" | " | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var map = { | |
pickup: 1, | |
driver: 2, | |
fare: 3, | |
car: 4, | |
city: 5, | |
payment_method: 6 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// time csvtojson data/order-interval-20180102.csv | node mockup/order-interval.js | |
var stdin = require('../../ppdg/ppdg-elk/src/stdinjson.js'); | |
var lodash = require('lodash'); | |
stdin(_process); | |
function _process (err, data) { | |
return lodash(data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EditorConfig is awesome: http://EditorConfig.org | |
# top-most EditorConfig file | |
root = true | |
# Unix-style newlines with a newline ending every file | |
[*] | |
end_of_line = lf | |
insert_final_newline = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
rundir=/var/run/parallelLimit | |
pause_file="$rundir/paused" | |
harakiri_file="$rundir/good-day-to-die" | |
is-paused() { | |
[ -f "$pause_file" ] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Source git completion and git prompts | |
command -v __git_ps1 > /dev/null || | |
for i in git-completion.bash git-prompt.sh | |
do | |
echo source ~/bin/$i | |
source ~/bin/$i | |
done | |
if declare -f __git_ps1 2>&1 >/dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
// if no arguments, take input from stdin | |
$argc < 2 && array_push($argv, file_get_contents("php://stdin")); | |
array_shift($argv); | |
$output = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git remote -v | grep fetch | grep github | \ | |
while read remote url _; do | |
if ! git config --get-all "remote.$remote.fetch" | grep -q refs/pull | |
then | |
git config --add "remote.$remote.fetch" \ | |
'+refs/pull/*/head:refs/remotes/'"$remote"'/pull/*' | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var table = $$('.emoji-card').map((el, i) => { | |
return { | |
emoji: el.firstChild.firstChild.innerHTML, | |
code: el.lastChild.firstChild.innerHTML, | |
description: el.lastChild.lastChild.innerHTML | |
}; | |
}).reduce((table, el, i) => { | |
var tr = document.createElement('tr'); | |
tr.innerHTML = '<td>' + el.emoji + '</td><td>' + el.code + '</td><td>' + el.description + '</td>'; | |
table.appendChild(tr); |