Skip to content

Instantly share code, notes, and snippets.

View willwhite's full-sized avatar

Will White willwhite

View GitHub Profile
@willwhite
willwhite / gist:628906
Last active September 23, 2015 22:57
// Use node.js to generate md5 hash
var hash = require('crypto').createHash('md5').update('STRING TO HASH').digest('hex');
@creationix
creationix / static.conf
Created February 9, 2011 06:35
my upstart config for creationix.com
description "start and stop the static stuff server"
version "1.0"
author "Tim Caswell"
# configuration variables.
env PATH=/home/tim/.nvm/HEAD/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
respawn
start on runlevel [23]
@stellaraccident
stellaraccident / control-block-http-example1.js
Created March 21, 2011 20:05
Bulletproof node coding snippets
request: function(options) {
var future=new Future();
var req=http.request(options, function(res) {
var text='';
res.setEncoding('utf8');
res.on('data', function(chunk) {
text+=chunk;
});
res.on('end', Block.guard(function() {
@kkaefer
kkaefer / pull-request
Created September 22, 2011 10:09
Converts an issue into a pull request. Works within one repository only and always pulls a branch into master. Requires github.user and github.token to be set.
#!/bin/sh
BRANCH_NAME=$(git symbolic-ref -q HEAD)
BRANCH_NAME=${BRANCH_NAME##refs/heads/}
BRANCH_NAME=${BRANCH_NAME:-HEAD}
REPO_NAME=`git config --get-regexp remote\..+\.url | perl -p -e 's/^remote\.\w+\.url\s+git\@github.com:(.+).git/\$1/'`
echo "Pulling $BRANCH_NAME into master of $REPO_NAME"
read -p "Issue #: " GITHUB_ISSUE
@willwhite
willwhite / index.html
Created October 8, 2011 19:59
Modest Maps layer switcher demo
<html>
<head>
<!-- NOTE: Do not use these URLs in production. If they ever change your site will break.
Instead, download the files to your web server and host them there. -->
<script src='https://raw.github.com/mapbox/wax/v3.0.8/ext/modestmaps.min.js' type='text/javascript'></script>
<script src='https://raw.github.com/mapbox/wax/v3.0.8/dist/wax.mm.js' type='text/javascript'></script>
<script src='http://code.jquery.com/jquery-1.6.4.min.js' type='text/javascript'></script>
</head>
<body>
<h3>Choose a layer</h3>
@bradland
bradland / ssh-known-hosts-mgmt.sh
Last active April 4, 2023 21:21
SSH known_hosts tools
# This is a short collection of tools that are useful for managing your
# known_hosts file. In this case, I'm using the '-f' flag to specify the
# global known_hosts file because I'll be adding many deploy users on this
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts
# Add entry for host
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts
# Scan known hosts
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com
@willwhite
willwhite / gist:1506819
Created December 21, 2011 17:14
Mapnik installation using brew on Mac OSX 10.7
  1. Install xcode
  2. Install homebrew
  3. Run the commands

.

brew install icu4c
brew link icu4c
brew install boost

brew install proj

#city[type='suburb'] {
marker-width: 0.2;
marker-fill: #fc0;
marker-line-width: 0;
marker-allow-overlap: true;
}
#city[type='hamlet'] {
marker-width: 0.4;
marker-fill: #f90;
@wboykinm
wboykinm / honeuro.mml
Created January 11, 2012 18:07
Euro Project Doc
{
"bounds": [
-180,
-85.05112877980659,
180,
85.05112877980659
],
"center": [
11.623535156250009,
43.96909818325171,
@tmcw
tmcw / index.html
Last active April 30, 2016 20:52
Running year-by-year
<html>
<head>
<title>runs over time</title>
<style>
body { margin: 0; padding: 0; background:#f8f8f8; }
svg {
font: 10px sans-serif;
}
path {
stroke: steelblue;