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
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
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
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
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
parse = (obj, path) -> | |
path = path.split(/[\[\]\.]+/) | |
path.pop() if path[path.length - 1] is "" | |
while path.length and (obj = obj[path.shift()]) | |
; | |
obj |
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 requeiredFieldOptions = { | |
watermarkText: "Enter age here...", | |
functionValidate: function(value) { | |
if (parseInt(value) < 18) { | |
return false; | |
} | |
return true; | |
}, | |
dataType: "number", | |
liveCheck: true |
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
// create a custom widget to be attached to each of the items created. | |
$.widget("ui.customwidget", { | |
options: { | |
listData:null | |
}, | |
_create: function (){ | |
this.element.addClass("ui-customwidget"); | |
$("<span></span>") | |
.text(this.options.listData.data.name + " is $" + this.options.listData.data.price) |
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 itemrendererOptions = { | |
labelField: "name", | |
rendererFunction: function (container, listData) { | |
if(listData.data.price > 100) { | |
container.css("color","red"); | |
} | |
container.html(listData.label); | |
}, | |
dataProvider: [ | |
{ |
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 itemrendererOptions = { | |
labelField: "name", | |
labelFunction: function (data, options) { | |
return data[options.labelField] + " is $ " + data.price; | |
}, | |
dataProvider: [ | |
{ | |
name: "lorem", | |
price: 123.34 | |
}, |