Skip to content

Instantly share code, notes, and snippets.

View bobbydavid's full-sized avatar

Robert Martin bobbydavid

View GitHub Profile

Example illustrating zoom and pan with a "rolling" Mercator projection. Drag left-right to rotate projection cylinder, and up-down to translate, clamped by max absolute latitude. Ensures projection always fits properly in viewbox.

@bobbydavid
bobbydavid / README.md
Last active August 29, 2015 14:17 — forked from mbostock/.block
@bobbydavid
bobbydavid / mongod.sh
Created April 29, 2012 20:27
Simple init.d script I wrote for starting/stopping mongod
#! /bin/sh
#
# Simple init.d script I wrote for starting/stopping mongod.
# Copyright (c) 2012 Robert Martin
#
# Filename: /etc/init.d/mongod
# (so rename it from mongod.sh to mongod)
#
### BEGIN INIT INFO
# Provides: mongod
@bobbydavid
bobbydavid / example_gist-in-tumblr.html
Created April 30, 2012 01:09
Example showing how to embed Gists in Tumblr using gist-in-tumblr
<p>Here's an example:</p>
<p class="gist">https://gist.github.com/2554645</p>
<p>Woah. Meta.</p>
@bobbydavid
bobbydavid / bashception.sh
Created April 30, 2012 14:44
Bashception. The shell is real.
#!/bin/bash
echo "Deeper."
. bashception.sh
@bobbydavid
bobbydavid / gist:2884356
Created June 6, 2012 19:59
example npm package list
└─┬ npm@1.1.18
├── chownr@0.0.1
├─┬ fstream@0.1.18
│ └── mkdirp@0.3.1 <--- make derpy
├─┬ fstream-npm@0.0.6
│ └─┬ fstream-ignore@0.0.5
│ └─┬ minimatch@0.2.4
│ └── lru-cache@1.0.6
├── graceful-fs@1.1.8
├── inherits@1.0.0
@bobbydavid
bobbydavid / INSTRUCTIONS
Created September 19, 2012 23:07
bash: give yourself useful recent directories with `cd` and `d` commands
Recommend to add aliases in `~/.bashrc` to use this scripts. For example:
alias cd='. ~/bin/cd-pushd.sh'
alias d='. ~/bin/dirs-good'
Causes, for example:
$ d 0 ~/bin
1 ~
2 /srv/www/project/ ... /long-directory-name
@bobbydavid
bobbydavid / commands.md
Created December 8, 2012 04:52
Editor commands I need

Navigation

  • line up/down.
  • page up/down (or 1/2 page).
  • left/right.
  • word left/right.
  • end of line / beginning of text on this line / 0-column on this line.
  • beginning of file / end of file.
  • drop/goto placeholder (marks).
@bobbydavid
bobbydavid / index.html
Last active December 18, 2015 15:59
d3 meta-visualization
<!doctype html>
<meta charset="utf-8">
<!-- author: Robert Martin -->
<style>
body {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
margin: auto;
position: relative;
import copy
import itertools
from collections import defaultdict
print 'Starting.'
key_words = ['PONIES', 'ACCEPT', 'SEARED', 'CAVIAR']
#wordfile = "/usr/share/dict/words"