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".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unmap J | |
map J nextTab | |
unmap K | |
map K previousTab | |
unmap d | |
map d removeTab | |
unmap x | |
unmap X | |
unmap u | |
map u restoreTab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<title>Count of Monte Cristo Character Mentions</title> | |
<script src="http://d3js.org/d3.v2.js?2.8.1"></script> | |
<div id="viz"></div> | |
<script> | |
function doGraph(rows){ | |
//scales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
_ = require 'underscore' | |
r = Math.random | |
rr = (x) -> ~~(r() * x) | |
#How wide is the main hall? | |
hallwidth = (rr(3) * 2) + 4 | |
#How tall can a room be? | |
#TODO make variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unbind C-b | |
set -g prefix ` | |
set -g history-limit 10000 | |
set -g status-bg blue | |
bind-key ` send-prefix | |
setw -g mode-keys vi | |
bind Escape copy-mode | |
bind-key -t vi-copy 'v' begin-selection | |
bind-key -t vi-copy 'y' copy-selection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
URxvt.background: black | |
URxvt.foreground: cyan | |
URxvt.scrollBar: false | |
URxvt.font: xft:ProFontWindows,\ | |
xft:Bitstream Vera Sans Mono,\ | |
xft:Ume Gothic O5,\ | |
xft:Hiragino Maru Gothic Pro,\ | |
xft:Osaka:style=Regular-Mono | |
URxvt.cursorBlink: true | |
#URxvt.font: xft:terminus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Load deps | |
fs = require('fs') | |
jsdom = require('jsdom').jsdom | |
yaml = require('js-yaml') | |
trans = require('transparency') | |
marked = require('marked') | |
_ = require('underscore') | |
#Load yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'abc' + ['x', 'y', 'z'].join | |
# OK | |
'abc' + ['x', 'y', 'z'].join('') | |
# OK | |
'abc' + (['x', 'y', 'z'].join '') | |
# OK | |
'abc' + ['x', 'y', 'z'].join '' | |
# SyntaxError: unexpected tSTRING_BEG, expecting end-of-input | |
# ??? |
OlderNewer