Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
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/sh | |
##################################################################### | |
# Program: git banish | |
##################################################################### | |
# Version: 1.0.0 | |
# Date: 2013-08-31 13:08:23 | |
# Author: Phillip Alexander (github.com/phillipalexander) | |
# | |
# Notes: See the excelent github article on this topic for more info | |
# https://help.github.com/articles/remove-sensitive-data |
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
/** | |
* Annoying.js - How to be an asshole to your users | |
* | |
* DO NOT EVER, EVER USE THIS. | |
* | |
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com) | |
* Visit https://gist.github.com/767982 for more information and changelogs. | |
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog | |
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors | |
* |
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}") |