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
Request { | |
domain: null, | |
_events: | |
{ error: [Function: bound ], | |
complete: [Function: bound ], | |
pipe: [Function], | |
data: [Function], | |
end: [Function] }, | |
_eventsCount: 5, | |
_maxListeners: undefined, |
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
{ | |
"local": { | |
"SOMEVAR1": "123_local", | |
"SOMEVAR2": "asdf banana", | |
"SOMEVAR3": "hello world" | |
}, | |
"production": { | |
"SOMEVAR1": "123_prod", | |
"SOMEVAR2": "asdf serious banana", | |
"SOMEVAR3": "hello serious world" |
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
/* | |
* Copyright (c) 2007-2012, Marketo, Inc. All rights reserved. | |
* Marketo marketing automation web activity tracking script | |
* | |
* $Id: munchkin.js 44633 2012-08-17 23:47:19Z dj $ | |
* $Rev: 44633 $ | |
*/ | |
var Munchkin = { | |
ASSOCIATE_LEAD: "associateLead", | |
CLICK_LINK: "clickLink", |
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
# classic async style | |
getData: (input, done) -> | |
output = Math.sin(input) * Math.cos(input) | |
done(output) | |
# async return through callback sugar | |
getData~ (input) -> | |
Math.sin(input) * Math.cos(input) |
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
# This form doesn't work | |
a = num for num in [0..364] | |
alert(a.join(",")) | |
# This form works | |
a = (num for num in [0..364]) | |
alert(a.join(",")) | |
# This form also works | |
a = then num for num in [0..364] |
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
# async example for Haifeng | |
iterator = (item, next) -> | |
result = item.split("").reverse().join() | |
next(result) | |
finished = (err, results) -> | |
console.log("finished with results: ", results) | |
async.map(["banana","apple","orange"], iterator, finished) |
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
# return true if _ is <= to __ | |
(=>((=>_)()<=(=>__)()))() | |
# call a method | |
((___)->alert(___[(((o)->"_-_-"[o])(o-1) for o in(__ for __ in[(for ____ of ___ then ____).toString().length..1])).join ""]()))("-_-_":->"cool!") |
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
# Convert any YouTube video into an audio file you can listen to on the go, using: | |
# http://rg3.github.com/youtube-dl/ | |
{ ~ } > brew install ffmpeg | |
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl | |
{ ~ } > chmod u+x youtube-dl | |
# Pick which video format you want to download.. (use any YT video link) | |
{ ~ } > ./youtube-dl -s -F http://www.youtube.com/watch?v=vT1KmTQ-1Os |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script src="./stativus.js"></script> | |
</head> | |
<body> | |
<div id="state-A" style="display: none; background-color: red; color: white;"> | |
<h1>State A</h1> | |
<div id="state-A1" style="display: none; background-color: orange; color: white;">leaf state A1</div> |
NewerOlder