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
function methodThatCleansUpStuff(){ | |
// dont return anything cause you are just cleaning up | |
} | |
function doAsyncStuff() { | |
return methodThatGivesAPromise() | |
.then(otherMethodThatGivesAPromise) | |
.then(()=>{throw new Error(“BOOM”)}) | |
.then(otherOtherMethodThatGivesAPromise) | |
.catch(methodThatCleansUpStuff) |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
function test_dir { | |
for i in `find $1 -type f|grep _test.rb`; do echo "$(tput bold)> $i$(tput sgr0)" && bundle exec ruby -Itest $i; done | |
} |
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 $private = $injector.has("$private") ? $injector.get("$private") : {}; | |
$private.myprivatfn = function (){}; | |
this.mypublicfn = function () { | |
$private.myprivatefn(); | |
}; |
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
# clean up merged local branches | |
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d |
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
console.log('hi'); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/hint/javascript-hint.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/javascript/javascript.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/edit/matchbrackets.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/addon/display/fullscreen.min.js"></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
(function() { | |
var Dancer = { | |
"start-dance": ["this"], | |
"stop-dance": ["this"] | |
}; | |
var DancerImpl = (function() { | |
var record = function(dancing) { | |
return this.dancing = dancing; | |
}; | |
record.prototype.$protocol = Dancer; |
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
;(function(){ | |
function f(a){return function(){return this[a]}}function n(a){return function(){return a}}var r; | |
function s(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null"; | |
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}var aa="closure_uid_"+(1E9*Math.random()>>>0),ca=0;function da(a,b){null!=a&&this.append.apply(this,arguments)}da.prototype.ia="";da.prototype.append=function(a,b,c){this.ia+=a;if(null!=b)for(var d=1;d<arguments.length;d++)this.ia+=arguments[d];return this};da.prototype.toString=f("ia");function t(a){ |
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
'use strict'; | |
/** | |
* @license AngularJS v1.2.0 | |
* (c) 2010-2012 Google, Inc. http://angularjs.org | |
* License: MIT | |
* | |
* TODO(vojta): wrap whole file into closure during build | |
*/ |