I've been doing some development on the wesabe-ssu project (I submitted a fix for the Amex scraper wesabe/ssu#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
#!/usr/bin/env coffee | |
sys = require('sys') | |
http = require('http') | |
## Argument parsing | |
args = process.argv.slice(2) | |
port = 9090 | |
delay = 0 |
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(exports) { | |
/*global __fail__*/ | |
/** | |
Define an assertion that will throw an exception if the condition is not | |
met. Ember build tools will remove any calls to ember_assert() when | |
doing a production build. | |
## Examples |
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
tell application "iPhoto" | |
set colorsAlbum to (new album name "COLORS") | |
set bwAlbum to (new album name "BW") | |
set allPhotos to (get photos of current album) | |
set isColor to true | |
repeat with thisPhoto in allPhotos | |
if isColor then | |
add thisPhoto to colorsAlbum | |
set isColor to false | |
else |
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
# From http://en.wikipedia.org/wiki/United_States_presidential_election, with percentages for the winners added. | |
1st 1788–1789 | |
George Washington (no party) – 69 electoral votes (56%) | |
John Adams (no party) – 34 electoral votes | |
John Jay (no party) – 9 | |
Robert H. Harrison (no party) – 6 | |
John Rutledge (no party) – 6 | |
2nd 1792 |
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 a = []; | |
Object.freeze(a); | |
a.push('foo'); | |
if (a.length === 1) { | |
console.log("FAIL Object.freeze() with Array"); | |
} else { | |
console.log("PASS Object.freeze() with Array"); | |
} |
This project is intended to reproduce a bug in which loading es6ify and then loading a file built using es6ify+browserify causes an exception in node.js. When run with grunt
the output is shown below:
Running "browserify:dist" (browserify) task
>> Bundled tmp/math.es5.js
Running "concat:dist" (concat) task
File "dist/math.js" 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
# tmux helper | |
_t_usage() { | |
echo "t SESSION # attach to SESSION or do \`z SESSION\` and create tmux SESSION" | |
} | |
t() { | |
case "$1" in | |
"-h" | "--help") | |
_t_usage | |
return 0 |
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
# tmux helper | |
_t_usage() { | |
echo "t SESSION # attach to SESSION or do \`z SESSION\` and create tmux SESSION" | |
} | |
t() { | |
case "$1" in | |
"-h" | "--help") | |
_t_usage | |
return 0 |
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 types = require('ast-types'); | |
var n = types.namedTypes; | |
var esprima = require('esprima'); | |
function printCommentsAndNode(ast, calculatePositionOffset) { | |
ast.comments.forEach(function(comment) { | |
if (comment.type !== 'Block' || comment.value[0] !== '*') { return; } | |
var associatedNode = findAssociatedNodeInAstForComment(ast, comment, calculatePositionOffset); | |
console.log('COMMENT'); |