Skip to content

Instantly share code, notes, and snippets.

View wcaleb's full-sized avatar

W. Caleb McDaniel wcaleb

View GitHub Profile
@beh
beh / gist:3549933
Created August 31, 2012 07:40
Add bookmark to pinbord.in with predefined tag, without user intervention
javascript:q=location.href;if(document.getSelection){d=document.getSelection();}else{d='';};p=document.title;void(open('https://pinboard.in/add?later=yes&noui=yes&jump=close&tags=TAGS GO HERE&url='+encodeURIComponent(q)+'&description='+encodeURIComponent(d)+'&title='+encodeURIComponent(p),'Pinboard','toolbar=no,width=100,height=100'));
// Copy and paste the above into a new bookmark. Replace "TAGS GO HERE" with your tags. Presto!
@apendleton
apendleton / letter_breakdown.py
Created May 8, 2012 19:57
Optimal alphabetical breakdown of registration lines
"""
This script ingests a CSV of last names and builds JSON output on the
percentage of last names that begin with each letter of the alphabet.
I initially ran it on a CSV-ified version of the US Census's list of all last
names with more than 100 occurrences, and used the frequency field within that
file to weigh the output, but absent that field, it assigns equal weight to
each name, allowing us to also process our TCamp 2012 attendence list.
Using the script on the Census data available in:
@ravasthi
ravasthi / _config.yml
Created February 15, 2012 08:59
Multiple authors on Jekyll
authors:
hanzou:
name: Hanzou Hattori
display_name: Hanzou
gravatar: c66919cb194f96c696c1da0c47354a6a
email: hanzou@company.com
web: http://company.com
twitter: company
github: hhattori
jorgen:
@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.
@gnip
gnip / Twitter (json format).js
Created January 4, 2011 00:49
Twitter Sample Payload, JSON format
{
"coordinates": null,
"created_at": "Thu Oct 21 16:02:46 +0000 2010",
"favorited": false,
"truncated": false,
"id_str": "28039652140",
"entities": {
"urls": [
{
"expanded_url": null,