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
#!/bin/sh | |
files=$(git diff --cached --name-only --diff-filter=ACM | grep ".js$") | |
if [ "$files" = "" ]; then | |
exit 0 | |
fi | |
pass=true | |
echo "\nValidating JavaScript:\n" |
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
// this sets the background color of the master UIView (when there are no windows/tab groups on it) | |
Titanium.UI.setBackgroundColor('#000'); | |
var win = Ti.UI.createWindow({ | |
title: "Window Title", | |
exitOnClose: true | |
}); | |
win.open(); | |
// CREATE MAP VIEW |
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 GO = { | |
init: function(){ | |
// Delete the property data | |
Ti.API.debug('Removing properties'); | |
Ti.App.Properties.removeProperty("latitude"); | |
Ti.App.Properties.removeProperty("longitude"); | |
Ti.App.Properties.removeProperty("geoAccuracy"); | |
Ti.App.Properties.removeProperty("geoTimestamp"); | |
var propTimestamp = Ti.App.Properties.getString("geoTimestamp"); |
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({ | |
backgroundColor:'white' | |
}); | |
win.open(); | |
var label = Ti.UI.createLabel({ | |
top: 20, | |
height: 200, | |
width: 200, | |
text: "Background the app" | |
}); |
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({ | |
backgroundColor:'white' | |
}); | |
var v = Ti.UI.createScrollView(); | |
win.add(v); | |
var v1 = Ti.UI.createView({ | |
height:Ti.UI.SIZE, | |
backgroundColor:'red' |
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 onsuccess(data){ | |
var jdata=JSON.parse(data); | |
var data=[]; | |
jdata.forEach(function(item){ | |
var payload={ | |
tweet:item.text | |
}; | |
var row=Alloy.createController('tweet.row',payload).getView(); |
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
# Version: 0.0.022 | |
# Please note: This has only been tested on Sublime Text 3 Build 3065 | |
# Installation: | |
# 1. Click "Download Gist" | |
# 2. Put alloy.py in: ~/Library/Application Support/Sublime Text 3/Packages/User/ | |
# 3. Set your layout to Grid 4 - Go to view > layout > Grid: 4 | |
# 4. Add to the bliss of working with Alloy... |
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
/** | |
Create Thumbnail of Video File | |
This snippet captures a thumbnail JPG image, based on a frame @ 2 second time-lapse. | |
Titanium Mobile | |
*/ | |
var movie = Titanium.Media.createVideoPlayer({ | |
contentURL:FILENAME, |
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
// Creates our main root window. Fullscreen all the way! | |
var win = require('/ui/common/window_home').createWindow(); | |
if(Ti.Platform.osname==='android'){ | |
// This Theme makes sure the windows are full screen and buttons aren't always in caps. | |
// mytheme.xml lives in /platform/android/res/values - see below. | |
win.open({theme: "MyAmazingTheme"}); | |
} else { | |
var rootNavWin = Titanium.UI.iOS.createNavigationWindow({ |
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
// implement like this: | |
var window = Ti.UI.createWindow({ | |
backgroundColor:'#fff' | |
}); | |
// draw the gridlines first so your other elements stack on top of them | |
// without requiring you to set the z-index property of each | |
var grid = require('gridlines'); | |
grid.drawgrid(10,window); |
OlderNewer