Skip to content

Instantly share code, notes, and snippets.

View alfonsodev's full-sized avatar
🏠
Working from home

Alfonso alfonsodev

🏠
Working from home
View GitHub Profile
package main
/*
* Script that scrapes google front page
* Usage: ./google [<query>]
* e.g. ./google hacker news
*/
import (
"fmt"
function hex_sha1(s) {
return binb2hex(core_sha1(str2binb(s), s.length * chrsz));
}
function b64_sha1(s) {
return binb2b64(core_sha1(str2binb(s), s.length * chrsz));
}
function str_sha1(s) {
return binb2str(core_sha1(str2binb(s), s.length * chrsz));

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

# References:
# http://blog.mixu.net/2011/08/13/nginx-websockets-ssl-and-socket-io-deployment/
# http://blog.exceliance.fr/2012/09/10/how-to-get-ssl-with-haproxy-getting-rid-of-stunnel-stud-nginx-or-pound/
#
global
nbproc 2
maxconn 16384
defaults
module.exports = function(callback) {
require('child_process').exec('./cursor-position.sh', function(error, stdout, stderr){
callback(error, JSON.parse(stdout));
});
}