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
| // run with "node --expose_gc" | |
| var weak = require('weak') | |
| , util = require('util') | |
| var count = 0 | |
| , countGc = 0 | |
| function dec () { | |
| count-- |
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 ED = ED || {}; | |
| // Utility functions | |
| ED.util = (function() { | |
| // Data structure functions | |
| function each(object, callback) { | |
| if (object === null) return; |
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
| function translate(tx, ty, func){ | |
| return function(x,y){ | |
| var xprime = x-tx; | |
| var yprime = y-ty; | |
| return func(xprime,yprime); | |
| } | |
| } | |
| function rotate(theta, func){ |
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
| /* | |
| In a child process, each of the stdio streams may be set to | |
| one of the following: | |
| 1. A new file descriptor in the child, dup2'ed to the parent and | |
| exposed to JS as a Stream object. | |
| 2. A copy of a file descriptor from the parent, with no other | |
| added magical stuff. | |
| 3. A black hole - no pipe created. |
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
| require 'json' | |
| require 'uri' | |
| require 'httpclient' | |
| require 'redis' | |
| require 'mw-irc' | |
| # First, get an access token for your account on the command line | |
| # curl -d '{"scopes":["repo"],"note":"Post-Receive Hooks"}' -u 'username:******' https://api.github.com/authorizations | |
| # Paste your access token here |
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
| /* | |
| In a child process, each of the stdio streams may be set to | |
| one of the following: | |
| 1. A new file descriptor in the child, dup2'ed to the parent and | |
| exposed to JS as a Stream object. | |
| 2. A copy of a file descriptor from the parent, with no other | |
| added magical stuff. | |
| 3. A black hole - no pipe created. |
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
| pep8 --statistics -qq --filename=*.py /usr/local/src/madrona/madrona/ | |
| pep8 --select=E202,E201 --repeat . > ~/pep8.txt | |
| vim -q ~/pep8.txt | |
| # :map z :cn | |
| # type z to cycle through all instances; puts your cursor right on the spot |
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
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <Map srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs" background-color="rgb(255,255,255)"> | |
| <Style name="drainage"> | |
| <Rule> | |
| <Filter>([HYC]=8)</Filter> | |
| <CompositingSymbolizer fill="rgb(153,204,255,127)" smooth="1" comp-op="exclusion"/> | |
| </Rule> | |
| </Style> | |
| <Style name="highway-border"> | |
| <Rule> |
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
| #!/usr/bin/env node | |
| /* | |
| * Parsing BIG compressed data with Node.js and SAX | |
| * Probably some bugs, but worked fine for OpenStreetMap Great Britain bz2 | |
| * Greg Miell 2012 | |
| */ | |
| // Simple string trim prototype extension | |
| String.prototype.trim = function() { |