Under Terminal > Preferences... > (Profile) > Advanced, "Declare terminal as:" should be set to xterm-256color
.
This is easy with homebrew:
brew install screen
import sys, csv, simplejson | |
from optparse import OptionParser | |
parser = OptionParser(usage='usage: %prog [options] csv_file json_file\n' """ | |
Merges data from a comma- (or tab-, pipe-, etc.) separated file into the | |
properties of GeoJSON features by joining on a foreign key, and prints the | |
resulting GeoJSON feature collection to stdout.""") | |
parser.add_option('-f', '--fk', dest='fk', default='id', | |
help='The CSV column and GeoJSON feature property name on ' | |
'which to join. This may either be a single string, or ' |
#!/bin/sh | |
FILE=`mktemp -t webview` | |
pbpaste >> $FILE | |
mv "$FILE" "$FILE.html" | |
open -a Safari "$FILE.html" |
<html> | |
<head> | |
<title>Polymaps don't like these dots</title> | |
<script type="text/javascript" src="https://github.com/simplegeo/polymaps/raw/master/polymaps.min.js"></script> | |
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> | |
<style type="text/css"> | |
html, body, #map { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
diff --git a/modestmaps.js b/modestmaps.js | |
index 869c650..dd50831 100644 | |
--- a/modestmaps.js | |
+++ b/modestmaps.js | |
@@ -134,7 +134,7 @@ if (!com) { | |
toKey: function() { | |
/* there used to be a clever hash function here but there were collisions. | |
TODO: optimize, but test for collisions properly :) */ | |
- return [ Math.floor(this.zoom), Math.floor(this.column), Math.floor(this.row) ].join(','); | |
+ return [ 'c', Math.floor(this.zoom), Math.floor(this.column), Math.floor(this.row) ].join('_'); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>U.S. Unemployment</title> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.min.js"></script> | |
<style type="text/css"> | |
body { | |
margin: 0; | |
padding: 2em; |
// replace "toner" here with "terrain" or "watercolor" | |
var layer = "toner"; | |
var map = new google.maps.Map(document.getElementById("element_id"), { | |
center: new google.maps.LatLng(37.7, -122.4), | |
zoom: 12, | |
mapTypeId: layer, | |
mapTypeControlOptions: { | |
mapTypeIds: [layer] | |
} | |
}); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<script type="text/javascript" src="https://raw.github.com/stamen/modestmaps-js/master/modestmaps.js"></script> | |
<style type="text/css"> | |
html, body, #map { | |
position: absolute; | |
width: 100%; | |
height: 100%; |
#!/usr/bin/env python | |
import optparse | |
parser = optparse.OptionParser(usage="%prog -k KEY -s SECRET -q QUEUE msg msg msg") | |
parser.add_option("--key", "-k", dest="key") | |
parser.add_option("--secret", "-s", dest="secret") | |
parser.add_option("--queue", "-q", dest="queue") | |
options, args = parser.parse_args() | |
from boto.sqs.connection import SQSConnection |
Under Terminal > Preferences... > (Profile) > Advanced, "Declare terminal as:" should be set to xterm-256color
.
This is easy with homebrew:
brew install screen
var request = function(options) { | |
var aborted = false, | |
abort = function() { | |
aborted = true; | |
}; | |
switch (options.type) { | |
case "jsonp": | |
// a very simplistic JSON-P implementation | |
var script = document.createElement("script"), |