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
// Outputting both a minified and non-minified version of your combined JavaScript files can be achieved by using gulp-rename and piping to dest twice (once before minifying and once after minifying): | |
'use strict'; | |
var gulp = require('gulp'); | |
var rename = require('gulp-rename'); | |
var uglify = require('gulp-uglify'); | |
var DEST = 'build/'; |
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
cd /Applications | |
xattr -d com.apple.quarantine APPNAME # e.g. Xcode6-Beta7.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 dispatcher = require('dispatcher'); | |
function onLogOutButtonClick(e) { | |
dispatcher.trigger('logout'); | |
} |
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 convertedHTML = htmlString; | |
// event-handler for app | |
convertedHTML = htmlString.replace(/<a href="((http|https)[^"]+)"[^>]*>(.*?)<\/a>/gmi, '<a href="$1" onclick="Ti.App.fireEvent(\'app:webViewClick\', {link: \'$1\'}); return false;">$3</a>'); | |
// mailto special | |
convertedHTML = convertedHTML.replace(/<a href="mailto:([^"]+)"[^>]*>(.*?)<\/a>/gmi, '<a href="mailto:$1" onclick="Ti.App.fireEvent(\'app:webViewClick\', {linkType: \'email\', link: \'$1\'}); return false;">$2</a>'); |
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
Delete this file | |
/Users/YOUR_USER/Library/Developer/CoreSimulator/Devices/SIM_UDID/data/Library/Preferences/APP_ID.plist |
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.addEventListener('click', function foo(e) { // note the named function expression needed for the second way | |
// oringal idea by @fukhaos | |
// http://www.tidev.io/2014/09/10/the-case-against-ti-app-fireevent-2/#comment-13013 | |
e.source.removeEventListener(e.type, arguments.callee); | |
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
// fire tracking event | |
require('/helpers/analytics/ga').screen(SCREENNAME); |
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
// fire analytics event | |
require('/helpers/analytics/ga').event(CATEGORY, ACTION, LABEL, 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
// the following code is both the logic and examples of using it | |
var win = Titanium.UI.currentWindow; | |
// I've set anyDensity to true in my app and this function enables the UI to properly scale | |
// you can safely delete this function and all references to it if you'd like | |
var adj = function(pixels) { | |
if(Titanium.Platform.name == 'iPhone OS') { | |
return pixels; | |
} 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
# on genymotion emulator adb has root access | |
# also possible for directories | |
adb pull /data/data/<package_name>/databases/<database_name> <local_file_path> |