⌘T | go to file |
⌘⌃P | go to project |
⌘R | go to methods |
⌃G | go to line |
⌘KB | toggle side bar |
⌘⇧P | command prompt |
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 bash | |
OUT=`${ANDROID_SDK_ROOT}/platform-tools/adb shell getprop init.svc.bootanim` | |
RES="stopped" | |
while [[ ${OUT:0:7} != 'stopped' ]]; do | |
OUT=`${ANDROID_SDK_ROOT}/platform-tools/adb shell getprop init.svc.bootanim` | |
echo 'Waiting for emulator to fully boot...' | |
sleep 5 | |
done |
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
// v1.1.4. https://github.com/viezel/NappDrawer/tree/master/ios/dist | |
var rootWin = Ti.UI.createWindow({ | |
backgroundColor: "#ccc" | |
}); | |
rootWin.addEventListener('click', function() { | |
var NappDrawerModule = require("dk.napp.drawer"); |
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
{ | |
"items":[ | |
{ | |
"type":"news", | |
"objectId":"F49BVNva6n", | |
"campus_id":"MYmJJGwRz8" | |
}, | |
{ | |
"type":"news", | |
"objectId":"R3SAI9ZVAJ", |
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
function getKeys(obj) { | |
var keys = Object.keys(obj); | |
keys.forEach(function(val) { | |
if (obj[val] instanceof Object) { | |
keys = keys.concat(getKeys(obj[val])); | |
} | |
}); | |
return keys; | |
} |
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
Alloy.isTablet = Alloy.isTablet || (Ti.Platform.model.search(/ipad/i) > -1); |
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 = { | |
getItem : function(_key) { | |
return Ti.App.Properties.getObject(_key); | |
}, | |
setItem : function(_key, _value) { | |
return Ti.App.Properties.setObject(_key, _value); | |
}, | |
removeItem : function(_key, _value) { | |
return Ti.App.Properties.removeProperty(_key); | |
} |
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(); | |
var button = Carbon.UI.create(win, '{ "children": { "Button": { title: "This is button" }} }'); |
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
function once(component, eventName, callback) { | |
if(component && component.addEventListener && eventName && callback) { | |
var wrappedCallback = function(e) { | |
component.removeEventListener(eventName, wrappedCallback); | |
callback.call(component, e); | |
}; | |
component.addEventListener(eventName, wrappedCallback); | |
} else { | |
Ti.API.error('"once" function illegal parameter'); | |
} |
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
# run on Android | |
var i = 0; | |
var win = { | |
backgroundColor: '#000', | |
__TiElement: null, | |
__getTiElement: function() { | |
if (!this.__TiElement) { | |
this.__TiElement = Ti.UI.createWindow(this); |
NewerOlder