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 userCreationStack = bernstein.create([ | |
| function (data, orig, next){ | |
| var imageProm = imageServiceWrapper.sliceAndDice(data.image); | |
| imageProm.then(function (imageData) { | |
| data.images = imageData; | |
| next(data); | |
| }); | |
| } |
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 funcArray = [function(data, orig, next){ | |
| data.num++; | |
| next(data); | |
| } | |
| , function(data, orig, next){ | |
| data.num++; | |
| next(data); | |
| } | |
| , function(data, orig, next){ | |
| data.num++; |
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
| somePromiseReturningFunction.then(function(data){ | |
| data.num++; | |
| return data; | |
| }).then(function(data){ | |
| data.num++; | |
| return data; | |
| }).then(function(data){ | |
| data.num++; | |
| return data; | |
| }).then(function(data){ |
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
| // NOTE: I previously suggested doing this through Grunt, but had plenty of problems with | |
| // my set up. Grunt did some weird things with scope, and I ended up using nodemon. This | |
| // setup is now using Gulp. It works exactly how I expect it to and is WAY more concise. | |
| var gulp = require('gulp'), | |
| spawn = require('child_process').spawn, | |
| node; | |
| /** | |
| * $ gulp server | |
| * description: launch the server. If there's a server already running, kill it. |
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 delegate (childIn) { | |
| var child = childIn; | |
| return function me(){ | |
| var that = this, | |
| oper = Object.getOwnPropertyNames(that).filter(function (attrib) { | |
| return(typeof that[child][attrib] === 'function' && me === that[attrib]); | |
| })[0]; | |
| return that[child][oper].apply(this[child], arguments); |
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 createSummary = function(str){ | |
| var str = str | |
| //tag replacement stuff | |
| , tagRegex = /<[^>]*>?/g | |
| , markerRegexGlobal = /~/g | |
| , markerRegex = /~/ | |
| , marker = '~' | |
| //other vars that we will need | |
| , refString = str.replace(tagRegex, marker) //replace out tags | |
| , i = 0 |
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
| javascript:!function(){var a=document.createElement("script"),b=function(){var a=$("p"),b=0,c="",d="";for(b=0;b<a.length;b++)c=$(a[b]).text(),d=c.slice(0,45)+"*"+c.slice(45,70)+"*"+c.slice(70),$(a[b]).text(d)};a.src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js",document.getElementsByTagName("head")[0].appendChild(a),setTimeout(b,500)}(); |
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
| t = ['john']; | |
| c = ['daniel','joe']; | |
| t.push(c); | |
| c.push(t); | |
| c; |
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 window = arr.length; | |
| for(var i = 0; < arr.length; i++){ | |
| for(var index = i; index >= 0; index--){ | |
| loopOverWindow(arr,window,index); | |
| } | |
| window --; | |
| } |
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
| <snippet> | |
| <content><![CDATA[ | |
| define([ | |
| 'modules/PadssView' | |
| ], function( | |
| PadssView | |
| ) { | |
| return PadssView.extend({ | |
| events: { |