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
Show hidden characters
{ | |
"globals": [ | |
"Ti": false, | |
"Titanium": false, | |
"Alloy": false | |
], | |
"node": 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
$.theRequire.doSomething(); | |
$.index.open(); |
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 always = new RegExp('(?:' + ['style', 'johnny ryall', 'sabotage', 'brooklyn', 'root down'].join('|') + ')', 'gim'); | |
function droppinScienceLikeGalileoDroppedTheOrange(lyrics) { | |
return lyrics | |
.replace(always, function(m, p1) { | |
return m.toUpperCase(); | |
}) | |
.replace(/\b([^\s]+?)(\r\n|\n|\r|$)/g, function(m, p1, p2) { | |
return p1.toUpperCase() + p2; | |
}); | |
} |
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
PULP [pulp] n. | |
1. A soft, moist, shapeless mass or matter. | |
2. A magazine or book containing lurid subject matter and | |
being characteristically printed on rough, unfinished paper. | |
American Heritage Dictionary: New College Edition |
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
if (someRuntimeCondition) { | |
@import('class2'); | |
} else { | |
@import('class1'); | |
} | |
// or | |
function foo() { | |
@import('bar'); |
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
{ | |
"jshint_options": { | |
"curly": true, | |
"eqeqeq": true, | |
"immed": true, | |
"latedef": "nofunc", | |
"loopfunc": true, | |
"maxlen": 100, | |
"newcap": true, | |
"noarg": 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
var _ = require('underscore'); | |
NormalNoXMLActivity.prototype.onCreate = function() { | |
// "this" refers to the NormalNoXMLActivity instance invoking this function | |
// save a reference to "this" | |
var self = this | |
_.each([1,2,3], function(i) { | |
// "this" no longer refers to the NormalNoXMLActivity, but "self" does |
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
<Alloy> | |
<Window> | |
<Widget src="genericContainer"> | |
<Label>hi there</Label> | |
<Label>another label</Label> | |
<Button>and a button</Button> | |
</Widget> | |
</Window> | |
</Alloy> |
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
// The base controller event handler, which will get overridden by the derived one | |
exports.doClick = function(e) { | |
alert('base click handler'); | |
}; | |
// We have to wait until the object is initialized before applying the event listener. This is so | |
// the derived listener is used, not the base one. Also, "$" must be used instead of "exports", to | |
// ensure that the overridden instance of the controller's "doClick" is used, not the exported | |
// version of the function from the base controller. | |
exports.init = function(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
var Alloy = require('alloy'), | |
Backbone = require('alloy/backbone'), | |
_ = require('alloy/underscore')._; |