An exercise in learning D3 / a proof of concept / my hat-in-the-ring for what comes next after Polymaps and Modest Maps. See the github project page for more information.
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Modest Maps JS - Throwable Test</title> | |
| <script type="text/javascript" src="modestmaps.min.js"></script> | |
| <script type="text/javascript"> | |
| (function(MM){ | |
| MM.ThrowableHandler = function() { } |
This file contains hidden or 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
| # to make a folder full of animated gifs into a folder full of vertical frames | |
| # (brew install imagemagick) | |
| for i in *.gif;do echo $i | |
| convert "$i" "`echo $i | sed -e 's/\.gif//g'`%02d.gif" | |
| convert "`echo $i | sed -e 's/\.gif//g'`*.gif" -append $i | |
| done | |
| # to make a folder full of html into a folder full of pdfs | |
| # (brew install wkhtml2pdf) |
This file contains hidden or 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
| var url = require('url'), | |
| mongodb = require('mongodb'); | |
| var sourceUrl = 'mongodb://user:pass@host:port/db', | |
| targetUrl = 'mongodb://user:pass@host:port/db', | |
| collectionName = 'my_awesome_collection'; | |
| function openDbFromUrl(mongoUrl, cb) { | |
| var dbUrl = url.parse(mongoUrl), | |
| dbName = dbUrl.pathname.slice(1), // no slash |
This file contains hidden or 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
| Key was generated using: | |
| tom% openssl genrsa -des3 -out example.com.key 2048 | |
| Generating RSA private key, 2048 bit long modulus | |
| ....+++ | |
| ..........................................................................................................................+++ | |
| e is 65537 (0x10001) | |
| Enter pass phrase for example.com.key: | |
| Verifying - Enter pass phrase for example.com.key: | |
| %tom |
This file contains hidden or 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
| web: node app.js | |
| worker: node consumer.js |
See issue 57 for discussion and planned improvements.
This file contains hidden or 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
| # don't hate me for this Makefile, at least I provided one | |
| BOOST_PATH = /Users/tom/Documents/Code/Cinder/Cinder/boost | |
| main: main.o | |
| g++ -o main main.o | |
| main.o: main.cpp | |
| g++ -c -I$(BOOST_PATH) -o main.o main.cpp |
This file contains hidden or 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
| // first of all make sure we have enough arguments (exit if not) | |
| if (process.argv.length != 5) | |
| { | |
| console.error("Usage: node csv2html.js input.csv template.ejs output.html") | |
| console.error(); | |
| console.error("Outputs the given template for each row in the given input.") | |
| console.error("Uses the first row of the CSV as column names in the template.") | |
| process.exit(1); | |
| } |
This file contains hidden or 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
| // see http://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B0000_to_U.2BD7FF_and_U.2BE000_to_U.2BFFFF | |
| function escapeBMP(n) { | |
| return '\\u'+('0000'+n.toString(16)).slice(-4); | |
| } | |
| // see http://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B10000_to_U.2B10FFFF | |
| function makeSurrogate(n) { | |
| var a = n - 0x10000; | |
| var highBits = a >> 10; | |
| var lowBits = a & 0x3FF; |