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> | |
<head> | |
<script> | |
// 238! | |
function L(U,C){var d=document,f='firstChild',r='readyState',h=d.documentElement[f],s=d.createElement('script'),m=s[r]?'onreadystatechange':0;s.src=U;s[m||'onload']=function(){if(!m||/ded|te/.test(s[r]))s[m]=0,C()}h.insertBefore(s,h[f])} | |
// async loading of javascript files, starting asap. | |
L("http://example.com/example.js",function () { | |
doSomething(); |
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
exports.app = function (env) { | |
return { | |
status : 200, | |
headers : {"Content-Type":"text/plain"}, | |
body : ["hello, 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
// more lines, ever-so-slightly faster search, though. | |
function checkValidMove (xo, pos, state) { | |
// invalid move. | |
if (state[pos[0]][pos[1]] !== '') return false; | |
state[pos[0]][pos[1]] = xo; | |
// check row | |
for (var i = 0, col = 0; i < 3; i ++) if (state[pos[0]][i] === xo) col ++; | |
if (col === 3) return "a winner is you"; |
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
isaacs@sistertrain-lm:~ | |
[16:46:52 6410] $ curl http://github.com/isaacs/npm/raw/master/bin/npm-install | bash | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
168 168 168 168 0 0 794 0 --:--:-- --:--:-- --:--:-- 1435 | |
/Users/isaacs/.npm-install | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 6259 100 6259 0 0 8974 0 --:--:-- --:--:-- --:--:-- 8974 | |
/Users/isaacs/.npm-install/isaacs-npm-0e7b3a9 |
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
# Node Package Manager | |
npm [npm-options] command [command options] | |
install <package> | |
[-b (stable, edge, nightly) | --branch] | |
[-f | --force] | |
[-v | --version] | |
remove <package> | |
[-f | --force] |
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
// npm --help | |
// | |
// npm - The Node Package Manager | |
// usage: npm [npm-options] <command> | |
// | |
// [npm-options] Options to be passed to the npm progam itself. | |
// | |
// -d --dry-run Don't do anything real | |
// | |
// -h --help Show this message |
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
/** | |
* @author apipkin and isaacs | |
*/ | |
EchoFin = EchoFin || {}; | |
EchoFin.itemsLoading = 0; | |
EchoFin.GlobalLoaded = false; | |
YUI().use('node', 'anim', function (Y) { |
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.names = { | |
user: "x" | |
,host: "x" | |
,server: "x" | |
,real: "x" | |
}; | |
// fuck IE | |
this.names = { | |
user: "x", |
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
(function () { | |
// transform the function such that you can fix any of the arguments, | |
// passing _ as a "placeholder". | |
// for example: | |
// function timesSquared (x, y) { return x * y * y } | |
// var times2Squared = _(timesSquared)( _, 2 ) or timesSquared._(_, 2); | |
// times2Squared(3) = timesSquared(3, 2) = 12 | |
// In the _ified function, if all the spaces are not filled in, it returns | |
// another _ified function with the remaining spaces blank. |
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
#!/usr/bin/env ruby | |
# urlmonitor - print out the URLs requested system wide on the main network interface | |
# Accept a network interface name as an optional argument | |
iface = ARGV.first | |
# No interface specified? Try to guess which one is king.. | |
unless iface | |
`ifconfig -l`.split.each do |iface| | |
next if iface =~ /^lo/ |