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
defmodule Porc do | |
defstruct status: nil, in: nil, out: nil, err: nil | |
def send_data(pid, data) do | |
send pid, {:data, data} | |
end | |
@doc """ | |
Takes a shell invocation and produces a tuple `{ cmd, args }` suitable for | |
use in `call()` and `spawn()` functions. |
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
set -e | |
git checkout gh-pages | |
git reset --hard master | |
bundle exec jekyll build | |
echo "dockeconf.com" > CNAME | |
git add . -A | |
git commit -m 'latest' | |
git push --force gh-pages | |
git checkout master |
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
// compose functions left to right, | |
// more readable than 'compose' | |
// => pipe(parseInt,Math.sqrt)("64.928") | |
// 8 | |
function pipe() { | |
var fns = arguments; | |
return function() { | |
var value = arguments; | |
for(var i = 0; i < fns.length; i++) { | |
value = [fns[i].apply(null,value)]; |
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 | |
names = ["Hekatonkheires","Agrius","Alcyoneus","Aloadae","Antaeus","Cyclopes","Cyclopes","Polyphemus","Enceladus","Gegenees","Geryon","Laestrygonians","Orion","Porphyrion","Talos","Tityos","Typhon","Achlys","Adephagia","Adikia","Aergia","Agon","Aidos","Alala","Alastor","Aletheia","Algea","Alke","Amechania","Amphilogiai","Anaideia","Androktasiai","Angelia","Apate","Apheleia","Aporia","Arae","Arete","Atë","Bia","Caerus","Corus","Deimos","Dikaiosyne","Dike","Dolos","Dysnomia","Dyssebeia","Eirene","Ekecheiria","Eleos","Elpis","Epiphron","Eris","Erotes","Anteros","Eros","Himeros","Pothos","Eucleia","Eulabeia","Eunomia","Eupheme","Eupraxia","Eusebeia","Euthenia","Gelos","Geras","Harmonia","Hebe","Hedone","Heimarmene","Homados","Homonoia","Horkos","Horme","Hybris","Hypnos","Hysminai","Ioke","Kakia","Kalokagathia","Keres","Koalemos","Kratos","Kydoimos","Lethe","Limos","Litae","Lyssa","Machai","Mania","Moirai","Clotho","Lachesis","Atropos","Momus","Moros","Neikea","Nemesis","Nike","Nomos","Oizys", |
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
// e.g | |
// asyncObject(net.connect,{port: 8125}) | |
function asyncObject(constructor) { | |
var args = [].slice.call(arguments,1); | |
var obj = constructor.apply(null,args); | |
return new Promise(function(resolve,reject) { | |
obj.once("error",reject); | |
obj.once("connect",function() { | |
resolve(obj); |
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 doParallelNTimes(n,concurrent,fn,cb) { | |
var outstanding = 0; | |
var complete = 0; | |
var nth = 0; | |
times(Math.min(concurrent,n),loop); | |
function loop() { | |
if(outstanding >= concurrent) { | |
return; |
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 app = angular.module("toggleInput",[]) | |
app.directive("toggleInput",function() { | |
return { | |
scope: true, | |
controller: function($scope) { | |
$scope.input = {visible: false} | |
}, |
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
Tooltip = ({@overEl,content,event,tooltipClass,clickable}) -> | |
@cleanup = [] | |
@el = $("<div class=tooltip></div>") | |
@el.addClass tooltipClass if tooltipClass | |
@el.append content | |
@el.css "visibility": "hidden" |
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
# grab install from http://www.enterprisedb.com/products-services-training/pgdownload#osx | |
# might need to replace version numbers | |
bundle config build.pg --with-pg-config=/Library/PostgreSQL/9.3/bin/pg_config | |
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
gem "https://rubygems.org" | |
gem "pg" # here's the target gem | |
__END__ # use the ever-useful __END__ to ignore the rest of our gems with no commenting required! | |
gem "rails" |