This file contains 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
// Modx | |
class Todo { | |
id = Math.random(); | |
@observable text; | |
@observable completed = false; | |
constructor(text) { | |
this.text = text; | |
} | |
} |
This file contains 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
module.exports = (server) => { | |
const db = server.dataSources.myConnectorDb; | |
const models = ['someModel', 'someOtherModel']; | |
function cb (models) { | |
return (err) => { | |
if(err) { | |
logger.error(err); | |
} else { |
This file contains 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
ps axl | grep node |
This file contains 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 TiBind = require("ti.bind"); | |
var data = [ | |
{ someTitle: "Hello World" } | |
]; | |
TiBind($, data); |
This file contains 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
/** | |
* Structure of an alloy controller | |
**/ | |
function Controller() { | |
var $ = this; | |
} | |
module.exports = Controller; | |
/** |
This file contains 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
/** | |
* Caching functions class | |
* @class Cache | |
*/ | |
var Moment = require("alloy/moment"); | |
var directory; | |
exports.valid = function (_url) { | |
var fileName = _url.replace(/[^\w\d]/g, ""); |
This file contains 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 activity = Ti.Android.currentActivity; | |
var intent = Ti.Android.createIntent({ | |
action : Ti.Android.ACTION_MAIN, | |
// you can use className or url to launch the app | |
// className and packageName can be found by looking in the build folder | |
// for example, mine looked like this | |
// build/android/gen/com/appcelerator/test/Test7Activity.java | |
// className : 'com.appcelerator.test.Test7Activity', | |
// if you use url, you need to make some changes to your tiapp.xml |
This file contains 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
#!/usr/bin/env node | |
var fs = require('fs'), | |
esprima = require('esprima'), | |
estraverse = require('estraverse'), | |
doctrine = require('doctrine'); | |
function analyze(node) { | |
var comment, data, params, missing; |
This file contains 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 Win = Ti.UI.createWindow({ | |
title: "My Message", | |
}); | |
var ScrollView = Ti.UI.createScrollView({ | |
height: Ti.UI.FILL, | |
width: Ti.UI.FILL, | |
contentHeight: "100%", | |
contentWidth: "100%", | |
}); |
This file contains 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 { fool, barl } = { | |
foo: "some string", | |
bar: (function() { /** stuff here **/ })(this) | |
}; | |
var [foo, [[bar], baz]] = [{ foo: MyObject, bar: () => { /** some craziness **/ } }, [[fool], barl]]; |
NewerOlder