Skip to content

Instantly share code, notes, and snippets.

View solidsnack's full-sized avatar

Jason Dusek solidsnack

  • Dallas, TX
  • 02:15 (UTC)
View GitHub Profile
@solidsnack
solidsnack / XGH - PT-BR.txt
Last active September 25, 2015 04:44 — forked from banaslee/XGH - en.txt
eXtreme Go-Horse Process
Fonte: http://gohorseprocess.wordpress.com
1- Pensou, não é XGH.
XGH não pensa, faz a primeira coisa que vem à mente. Não existe
segunda opção, a única opção é a mais rápida.
2- Existem 3 formas de se resolver um problema, a correta, a errada e
a XGH, que é igual à errada, só que mais rápida.
@solidsnack
solidsnack / 14.04-ebs.json
Last active May 27, 2016 23:33 — forked from sborsje/10.04-LTS-EBS.json
14.04-amd64-ebs.json
{
"AWSRegionArch2AMI": {
"ap-northeast-1": {
"amd64XhvmXebs": "ami-9e5cff9e",
"amd64XhvmXebsXio1": "ami-a05cffa0",
"amd64XhvmXebsXssd": "ami-a25cffa2",
"amd64XhvmXephemeral": "ami-de5efdde",
"amd64Xebs": "ami-925cff92",
"amd64XebsXio1": "ami-985cff98",
"amd64XebsXssd": "ami-9c5cff9c",
@solidsnack
solidsnack / getQueryParams.js
Last active August 29, 2015 14:14 — forked from ryoppy/getQueryParams.js
Parse query string, accepting multiple parameters
/**
* Parse query string.
* ?a=b&c=d&e=f&e=g to {a: 'b', c: 'd', e: ['f', 'g']}
* @param {String} (optional) queryString
* @return {Object} query params
*/
getQueryParams: function(queryString) {
var query = (queryString || window.location.search).replace(/^[?]/, ''),
result = {};
if (!query) return result;
> console
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_55).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import java.net.{ InetAddress, Inet6Address }
import java.net.{InetAddress, Inet6Address}
@solidsnack
solidsnack / memusg
Last active December 17, 2015 12:39 — forked from netj/memusg
Clean up variable declarations.
#!/bin/bash
set -o errexit -o nounset -o pipefail
function -h {
cat <<USAGE
USAGE: memusg COMMAND [ARGS]
Measure memory usage of processes.
This script is inspired by a script of the same name written by Jaeho Shin
<netj@sparcs.org>.
@solidsnack
solidsnack / chan.hs
Last active December 11, 2015 18:48 — forked from scan/chan.hs
Use of `maybe` combinator.
import Control.Applicative
import Control.Concurrent.Chan (Chan, newChan)
import qualified Data.Map as M
import Control.Concurrent.STM (atomically, TVar, readTVar, writeTVar)
import Control.Monad.Trans
type Id = Integer
getOrCreateChannel :: (MonadIO m) => Id -> TVar (M.Map Id (Chan a)) -> m (Chan a)
getOrCreateChannel cid t = liftIO $ do
@solidsnack
solidsnack / gist:4636841
Last active December 11, 2015 17:48 — forked from kowey/gist:4633875
One can use read and redirection if the files are line delimited. Preferring while/read to expansion makes for more robust scripts.
#!/bin/bash
set -o errexit -o pipefail -o nounset
cat_bundle () {
local file="$1"
echo ""
echo ""
echo "; ----------------------------------------------------------------------"
echo "; $(basename $file)"
echo "; ----------------------------------------------------------------------"