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
Show hidden characters
{ | |
"cmd": ["node", "$file"] | |
, "selector": "source.js" | |
, "path": "/usr/local/bin" | |
, "working_dir": "$project_path" | |
, "variants": | |
[ | |
{ | |
"name": "Run", | |
"cmd": ["js2coffee", "$file"], |
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
#depends on underscore | |
_.isConstructor = (thing) -> | |
if thing.name && thing.name[0].toUpperCase() == thing.name[0] | |
true | |
else | |
false | |
class Instrumentor | |
constructor: (namespace) -> |
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
var Stack = function() { | |
return Object.create(Stack.prototype, { | |
_storage: { value: [], writable: false, configurable: false } | |
}); | |
}; | |
Stack.prototype = Object.create(null); | |
Stack.prototype.add = function(element) { | |
// ... |
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
copy = function(str, mimetype) { | |
document.oncopy = function(event) { | |
event.clipboardData.setData(mimetype, str); | |
event.preventDefault(); | |
}; | |
document.execCommand("Copy", false, null); | |
} |
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
#!/bin/bash | |
for FILE in `find . -name "*.js" -type f -o -path './node_modules' -prune -o -path './components' -prune` | |
do | |
if [ -e $FILE ] ; then | |
COFFEE=${FILE//.js/.coffee} | |
echo "converting ${FILE} to ${COFFEE}" | |
js2coffee "$FILE" > "$COFFEE" | |
else |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://npmjs.org/install.sh | sh |
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
injectLib = do -> | |
scriptSrc = prompt('Source to inject') | |
head = document.getElementsByTagName('head') | |
body = document.getElementsByTagName('body') | |
target = if head? then head else body | |
scriptEl = document.createElement('script') | |
scriptEl.src = scriptSrc | |
target[0].appendChild(scriptEl) | |
console.log("injected: #{scriptSrc}") |
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
/* | |
Grep.js | |
Author : Nic da Costa ( @nic_daCosta ) | |
Created : 2012/11/14 | |
Version : 0.2 | |
(c) Nic da Costa | |
License : MIT, GPL licenses | |
Overview: | |
Basic function that searches / filters any object or function and returns matched properties. |
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
# These are my notes from the PragProg book on CoffeeScript of things that either | |
# aren't in the main CS language reference or I didn't pick them up there. I wrote | |
# them down before I forgot, and put it here for others but mainly as a reference for | |
# myself. | |
# assign arguments in constructor to properties of the same name: | |
class Thingie | |
constructor: (@name, @url) -> | |
# is the same as: |
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
{ | |
"name": "flare", | |
"children": [ | |
{ | |
"name": "analytics", | |
"children": [ | |
{ | |
"name": "cluster", | |
"children": [ | |
{"name": "AgglomerativeCluster", "size": 3938}, |