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 la = new Array(500); | |
for (var i = 0; i < la.length; i++) { | |
la[i] = i; | |
} | |
var target = []; | |
var loop = function () { | |
var temp = la; | |
var slices = 50; |
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 ViewA = Backbone.View.extend({ | |
events: { | |
'click .my-button': 'onMyButtonClick' | |
} | |
}); | |
var ViewB = Backbone.View.extend({ | |
ui: { | |
myButton: '.my-button' | |
} |
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 callbackSliceArgs(callback, howMany) { | |
return function() { | |
var args = _.toArray(arguments); | |
args.splice(howMany, args.length); | |
return callback.apply(null, args); | |
}; | |
} |
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 call(method) { | |
var args = Array.prototype.slice.call(arguments); | |
var callback = args.pop(); | |
args = args.slice(1); | |
var error; | |
var result; | |
try { | |
result = method.apply(null, args); | |
} catch (e) { | |
error = e; |
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
{ | |
"bold_folder_labels": true, | |
"caret_style": "phase", | |
"color_scheme": "Packages/User/moiz-theme/Moiz Black.tmTheme", | |
"fade_fold_buttons": false, | |
"flatland_sidebar_tree_xsmall": true, | |
"flatland_square_tabs": true, | |
"folder_exclude_patterns": | |
[ | |
".svn", |
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
/* | |
* credit of `getMatchedStyle` method for stakoverflow's Qtax | |
* http://stackoverflow.com/questions/9730612/get-element-css-property-width-height-value-as-it-was-set-in-percent-em-px-et/9733051#9733051 | |
*/ | |
function getMatchedStyle(elem, property) { | |
// element property has highest priority | |
var val = elem.style.getPropertyValue(property); | |
// if it's important, we are done | |
if (elem.style.getPropertyPriority(property)) |
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 getPageTitle(ctx, done) { | |
const data = ctx.value; | |
const regex = new RegExp(/title>(.*?)<\/title>/g); | |
const title = data.match(regex); | |
done(null, {title: title}); | |
} | |
exports = { | |
"source:everything": { | |
"url": "http://api.nick.com/api/v2/tv-schedule/?apiKey=nickjr.com&numberOfDays=2", | |
}, |
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
exports = { | |
'source:getTrending': { | |
url: 'http://api.giphy.com/v1/gifs/trending?api_key=dc6zaTOxFJmzC' | |
}, | |
// get all images | |
'model:getAllImages': { | |
// will execute source:getTrending and pass it as the context | |
before: 'source:getTrending', | |
// because the service returns everything | |
// under 'data' property, this will access that path |
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
exports = { | |
'source:getTrending': { | |
url: 'http://api.giphy.com/v1/gifs/feqkVgjJpYtjy?api_key=dc6zaTOxFJmzC' | |
} | |
}; |
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
Hello world!! |