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
curl --include --request POST 'https://shippo.p.mashape.com/addresses/' \ | |
--header "X-Mashape-Authorization: <mashape-key>" \ | |
--user "<username>:<password>" \ |
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 sources, destinations, lr, gulp, gutil, jade, stylus; | |
gulp = require('gulp'); | |
jade = require('gulp-jade'); | |
gutil = require('gulp-util'); | |
stylus = require('gulp-stylus'); | |
sources = { | |
jade: "jade/**/*.jade", | |
stylus: "stylus/**/*.stylus", |
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 mhash = require("mhash").hash | |
var md5 = require("md5") | |
var crypto = require('crypto') | |
var packages = ['mhash','md5','crypto'] | |
md5benchmark(packages) | |
function md5benchmark(packages) { | |
var max = 100000 |
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 predictions = predict(913,new Date()) | |
console.log(predictions) | |
function predict(count,date) { | |
var timestamp = date.getTime() | |
var y = date.getFullYear(), m = date.getMonth(), d = date.getDate() | |
var beginningOfDay = new Date(y, m, d).getTime() | |
var endOfDay = new Date(y, m, d+1).getTime() | |
var pacePerDay = count / (timestamp - beginningOfDay) |
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 Calculator(num){ | |
return { | |
answer : num ? num : 0, | |
equals : function() { | |
return this.answer | |
}, | |
add : function(num) { | |
this.answer += num ? num : 1 | |
return this | |
}, |
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
// The magic module that makes this all possible | |
var cluster = require('cluster') | |
// Boss gets everyone to work | |
if (cluster.isMaster) { | |
// The crew made of worker threads | |
var crew = [] | |
// The state of the job to pass between boss and workers |
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 fish | |
# Ubuntu Message of The Day | |
if test -f /etc/update-motd.d/* | |
chmod -x /etc/update-motd.d/* | |
end | |
# Fish Shell Greeting | |
set line1 "# Don't Show Fish Greeting" | |
set line2 "set --erase fish_greeting" |
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
# place this in your fish path | |
# ~/.config/fish/config.fish | |
function fish_greeting | |
if not type fortune > /dev/null 2>&1 | |
apt-get install fortune | |
end | |
fortune -a | |
end |
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
# Easy way to check for dependencies | |
checkfor () { | |
command -v $1 >/dev/null 2>&1 || { | |
echo >&2 "$1 required"; | |
exit 1; | |
} | |
} | |
checkfor "ffmpeg" | |
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
Here is a few examples how you can play with the data | |
# get the data, saving as names.tsv in current working directory | |
curl -o names.tsv https://gist.githubusercontent.com/montanaflynn/d5c882ad680f94b972f6/raw/1d3ecfb6dae48e119961fe299062a21c0c3ae1ab/names.tsv | |
# convert tsv to csv | |
cat names.tsv | tr "\\t" "," > names.csv | |
# print the most post popular girls name throughout all the years | |
cat names.tsv | tail -n +2 | awk '{print $2}' | sort | uniq -c | sort -nr |
OlderNewer