Links:
How do we stop execution of functions if one fails?
def process_checkout(order) do
| /** | |
| * Module that implements non-jQuery script injection with Deferred/Promise support (using | |
| * Q.js ). | |
| * | |
| * This deferred load notifies caller when the script is loaded... so chaining | |
| * or post load actions is easily supported. | |
| * | |
| */ | |
| ( function( win, doc, $q ){ | |
| "use strict"; |
Links:
How do we stop execution of functions if one fails?
def process_checkout(order) do
| find . -d -name node_modules | while read line; do rm -rf $line; done |
| ▶ brew list -1 | while read line; do brew unlink $line; brew link $line; done | |
| Unlinking /usr/local/Cellar/appledoc/2.2... 0 links removed | |
| Linking /usr/local/Cellar/appledoc/2.2... 1 symlinks created | |
| Unlinking /usr/local/Cellar/autoconf/2.69... 0 links removed | |
| Linking /usr/local/Cellar/autoconf/2.69... 18 symlinks created | |
| Unlinking /usr/local/Cellar/bash-completion/1.3... 184 links removed | |
| Linking /usr/local/Cellar/bash-completion/1.3... 182 symlinks created | |
| Unlinking /usr/local/Cellar/bgrep/0.2... 0 links removed | |
| Linking /usr/local/Cellar/bgrep/0.2... 1 symlinks created | |
| Unlinking /usr/local/Cellar/binutils/2.24... 49 links removed |
| /* MVC */ | |
| // MODEL | |
| function ModelBase(attributes) { | |
| for (var attr in attributes) { | |
| this[attr] = attributes[attr]; | |
| } | |
| this._eventHandlers = {}; | |
| } |
| // using native JS | |
| function filter(list, predicate) { | |
| list.reduce(function(prev, curr, i, arr) { | |
| if (!predicate(curr)) arr.splice(i, 1); | |
| }, []); | |
| return list; | |
| } | |
| // using Underscore |
| // 1. Right-click on the bookmarks toolbar | |
| // 2. Click Add Page... | |
| // 3. Name: <enter whatever you'd like> (Mine is Genius Annotate) | |
| // 4. Paste the following into the URL field (including the keyword javascript and the colon): | |
| javascript: window.location.replace('http://genius.it/' + window.location.href) |
| <!DOCTYPE html> | |
| <html ng-app="myApp"> | |
| <head> | |
| <meta name="AngularJS Isolate Scope Bindings" content="Binding to Isolate Scope" /> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
| <meta charset="utf-8"> | |
| <title>AngularJS Isolate Scope Bindings</title> | |
| </head> | |
| <body ng-controller="MainCtrl as main"> |
| var MakeSingleton = function(){ | |
| var obj; | |
| return function() { | |
| if( obj ){ | |
| return obj; | |
| } else{ | |
| obj = this; | |
| } | |
| }; | |
| }; |
| /** | |
| * Write a simple join function in the various styles: | |
| * 1. Imperative | |
| * 2. Object-oriented | |
| * 3. Functional language | |
| */ | |
| // Imperative | |
| function simpleJoin( stringArray ) { | |
| var accumulator = ''; |