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
// ==UserScript== | |
// @name GitHub Issues Canonicalizer | |
// @namespace http://about.me/satyr | |
// @include https://github.com/*/*/issues* | |
// ==/UserScript== | |
setTimeout(function(){ | |
Array.forEach(document.links, function(a){ | |
var m = /^#issue\/(\d+)$/.exec(a.hash) | |
if(m) a.href = /^.+\/issues\//.exec(a.pathname) + m[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
name= if previous_keys.length > 0 | |
then "#{main_key}[#{_.implode('][', previous_keys)}][#{key}]" | |
else "#{main_key}[#{key}]" |
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
for fileName in list then do -> | |
fs.readFile fn = fileName, (err, contents) -> | |
compile fn, contents.toString() |
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
$ bin/coffee -ne '(a,@b,c...)->d=e.f' | |
CodeNode "a" "@b" "c..." | |
Expressions | |
AssignNode | |
ValueNode "d" | |
ValueNode "e" | |
AccessorNode "f" |
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 CS = require('./lib/coffee-script'); | |
var code = require('fs').readFileSync('examples/underscore.coffee').toString(); | |
var start = Date.now(); | |
var tokens = CS.tokens(code); | |
require('sys').puts(Date.now() - start +'ms ('+ tokens.length +' tokens)'); |
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
// ==UserScript== | |
// @name Hatena Graph Previewer | |
// @namespace http://twitter.com/m_satyr | |
// @include http://graph.hatena.ne.jp/*/edit* | |
// @license X | |
// ==/UserScript== | |
var gedit = document.getElementById('graphedit'); | |
var table = gedit.querySelector('table'); | |
var graph = gedit.appendChild(new Image); | |
var titles = document.getElementById('titlecel').children; |
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
javascript:alert(function(){}) | |
// SpiderMonkey / Rhino | |
function () { | |
} | |
// v8 | |
function (){} | |
// JavaScriptCore |
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
<script src="JSLitmus.js"></script><script> | |
JSLitmus.test('for(;;)', function(){ | |
var i = 9999; | |
for(;;) if(!--i) break; | |
}); | |
JSLitmus.test('while(true)', function(){ | |
var i = 9999; | |
while(true) if(!--i) break; | |
}); | |
</script> |
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
# for CoffeeScript 0.9.3 | |
@clone = (it, mixes...) -> | |
i = new (clone.r it) | |
i.__proto__ ||= it | |
for mix in mixes | |
if typeof mix is 'function' | |
mix.call i, it, i | |
else | |
for k, v of mix then i[k] = v |
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
<script src="JSLitmus.js"></script><script> | |
(function(){ | |
(function(){ | |
(function(){ | |
(function(){ | |
(function(){ | |
(function(){ | |
(function(){ | |
(function(){ | |
(function(){ |