Skip to content

Instantly share code, notes, and snippets.

View polm's full-sized avatar

Paul O'Leary McCann polm

View GitHub Profile
@polm
polm / vimium.conf
Created April 4, 2012 03:17
Vimium settings
unmap J
map J nextTab
unmap K
map K previousTab
unmap d
map d removeTab
unmap x
unmap X
unmap u
map u restoreTab
@polm
polm / README.md
Created November 11, 2011 09:42 — forked from anonymous/gist.html
World Generator with d3

World Generator

This code creates a Voronoi Diagram of a low-resolution space, generating an approximation of regional divisions of an overworld map typical of the first Legend of Zelda or Link's Awakening. The white squares are randomly generated "centers".

http://en.wikipedia.org/wiki/Voronoi_diagram

/* Inspired by Lee Byron's test data generator. */
function stream_layers(n, m, o) {
if (arguments.length < 3) o = 0;
function bump(a) {
var x = 1 / (.1 + Math.random()),
y = 2 * Math.random() - .5,
z = 10 / (.1 + Math.random());
for (var i = 0; i < m; i++) {
var w = (i / m - y) * z;
a[i] += x * Math.exp(-w * w);
@polm
polm / gist:1072271
Created July 8, 2011 17:02
Selenium blows up with innerHTML and unicode
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
driver.get("http://dampfkraft.com/emdash.html")
print driver.find_element_by_tag_name("p").get_attribute("innerHTML")