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 zsh | |
# 03/2013 | |
curl -s $1 |\ | |
awk '/embed src/' |\ | |
urldecode.awk |\ | |
grep -o 'http[a-zA-Z0-9.,:/_?=-]+asPlayerXml.xml' |\ | |
xargs curl -s |\ | |
grep -o 'http[a-zA-Z0-9.,:/_?=-]+xml' |\ |
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
~ % for i in $(say -v\? | cut -f1 -d\ ); do echo -n "$i "; say -v $i hello; done | |
~ % say -v\? | awk '{print $1}' | while read -r l; do echo -n "$l "; say -v $l hello; done | |
~ % say -v\? | while read -r l; do l=(${=l}); echo -n "$l[1] "; [1]; say -v $l[1] $l[4,-1]; done # littl bit broken |
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
multiply: (a, n) -> | |
i = 0 | |
while i < a.length | |
j = 0 | |
while j < n - 1 | |
a[i] = a[i].concat(a[i]) | |
j++ | |
i++ | |
a |
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 ruby | |
# -*- encoding: utf-8 -*- | |
# | |
# Thu Nov 28 15:47:21 CET 2013 | |
# 2013 (c) René Wilhelm <[email protected]> | |
# | |
# jq '.publisher + ": " + .name + " (" + .author + ")"' it-books.json | |
# Todo: Exit condition |
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 zsh -e | |
# Thu Dec 12 00:04:47 CET 2013 | |
# 2013 (c) [email protected] | |
# Dump tables and schema from a PostgreSQL database. | |
# Usage: $0 [database_name] [num_records] | |
d=${1:=$USER} # database, defaults to current username | |
n=${2:=1000} # number of records to export, defaults to 1000 |
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 zsh | |
# Mon Dec 23 05:48:33 CET 2013 | |
# 2013 (c) [email protected] | |
# plays frequencies | |
f=${1:=440} | |
pids=() | |
freq() { |
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
{ | |
"features": [ | |
{ | |
"properties": { | |
"ts": 1387554909603, | |
"id": 177 | |
}, | |
"geometry": { | |
"coordinates": [ | |
[ |
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
[Unit] | |
Description=Start Herir Node.js Service | |
Requires=network.target | |
After=network.target | |
[Service] | |
Type=forking | |
WorkingDirectory=/srv/hereir/node | |
ExecStart=/usr/bin/forever start --pidFile /var/run/hereir.pid HereIR.js | |
ExecStop=/usr/bin/forever stop HereIR.js |
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 zsh | |
# https://github.com/sramsay/wu/issues/28 | |
# array containing our ~/.condrc suffixes (e.g. ~/.condrc.tokyo) | |
a=($(ls -1 ~/.condrc.* | awk -F. '{print $NF}')) | |
# check if our array contains the first given argument | |
if [[ ${a[(r)$1]} == $1 ]]; then | |
loc=$1; shift |
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
// find trip array index by trip id | |
var findById = function (source, trip_id) { | |
var length = source.length; | |
for (var i = length - 1; i >= 0; --i) { | |
if (source[i].trip_id === trip_id) { | |
return i; | |
} | |
} | |
throw "Couldn't find trip with id: " + trip_id; | |
}; |