Skip to content

Instantly share code, notes, and snippets.

View kennknowles's full-sized avatar
☂️

Kenn Knowles kennknowles

☂️
View GitHub Profile
#!/bin/bash
# This is a utility script to merge pull requests into Apache Beam
# repositories. It supports both repositories, source and website.
#
# Usage:
# merge_pr.sh [repository] [branch] pull_request_number
#
# Where:
# repository: { beam | beam-site }

Codd - building immutable SQL queries from relational primitives

Codd is a new SQL query building library that is the spiritual successor to Gesundheit. In Gesundheit, a "query" was a mutable object with methods that modified a (nominally) internal AST for a SQL statement. While this enabled an API that was both familiar and expressive, it had some unfortunate side-effects (pun intended). For example, making a non-destructive modification to an existing query requires a deep copy of it's AST.

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@simonmichael
simonmichael / gist:1185421
Created September 1, 2011 03:59
ghc-pkg-clean, ghc-pkg-reset
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages.
# ghc-pkg-clean -f cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place.