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 | |
# Github -> Bitbucket | |
# - Save this in /usr/local/bin as github-to-bitbucket | |
# - Then: | |
# cd /usr/local/bin | |
# chmod u+x github-to-bitbucket | |
# - Then restart your terminal | |
# - You should now have a github-to-bitbucket command |
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
// io.js | |
define(['jquery'], function ($) { | |
return $({}); | |
}); | |
... | |
// main.js | |
require(['io', 'toast'], function (io, toast) { | |
io.on('my_event', function () {}); |
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 | |
# Commit and sync to Github | |
# To install, run: | |
# cd /usr/local/bin && wget -O commit-and-sync https://gist.github.com/phuu/5680243/raw/gistfile1.sh && chmod u+x commit-and-sync | |
# then restart yaw terminals. | |
BRANCH="$(git symbolic-ref HEAD 2>/dev/null)" | |
# Reconnaissance |
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 | |
# install: | |
# cd /usr/local/bin && wget -O stage-me https://gist.github.com/phuu/5704768/raw/gistfile1.sh && chmod u+x stage-me | |
branch=`git symbolic-ref HEAD 2>/dev/null | cut -d"/" -f 3-` | |
echo "Merging ⭠ $branch into ⭠ staging." | |
read -p "Is this correct? [y/N] : " -r | |
if [[ $REPLY =~ ^[Yy]$ ]] | |
then |
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
/** | |
* Defer callable. Kinda tricky to explain. Basically: | |
* "Don't make newFn callable until I tell you via this trigger callback." | |
* | |
* Example: | |
// Only start logging after 3 seconds | |
var log = function (str) { console.log(str); }; | |
var deferredLog = deferCallable(log, function (done) { | |
setTimeout(done, 3000); |
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 (scope, name, fn, map) { | |
if (typeof define === 'function' && define.amd) { | |
define(fn) | |
} else if (typeof exports === 'object') { | |
var rtn = fn(require, module.exports, module); | |
if (module.exports !== rtn && | |
typeof rtn !== 'undefined') module.exports = rtn; | |
} else { | |
var exp = {}, mod = { exports: exp }, | |
reqr = function (i) { return map[i] ? scope[map[i]] : scope[i]; }; |
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
{ URI: | |
{ root: 'URI.js', | |
files: { default: 'URI.min.js', minified: 'URI.min.js' }, | |
versions: [ '1.7.2' ] }, | |
accounting: | |
{ root: 'accounting.js', | |
files: { default: 'accounting.js', minified: 'accounting.min.js' }, | |
versions: [ '0.3.2' ] }, | |
ace: | |
{ root: 'ace', |
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 events = require('events'); | |
undefined | |
> var ee = new events.EventEmitter(); | |
undefined | |
> var thing1 = Object.create(ee); | |
undefined | |
> var thing2 = Object.create(ee); | |
undefined | |
> thing1.on('fish', console.log.bind(console, 'thing1')); | |
{} |
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
a=require;a('http').createServer(function(b,c){d=a('url').parse(b.url,1).query;setTimeout(c.end.bind(c),d.t,c.writeHead(302,{Location:d.u}))}).listen(3e3) |
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> | |
<meta charset=utf-8 /> | |
<title></title> | |
#yolo |