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
CloudPush.retrieveDeviceToken({ | |
success: function(_data) { | |
Ti.API.info("ACS.init @success"); | |
exports.deviceToken = _data.deviceToken; | |
Ti.App.Properties.setString("PUSH_DEVICETOKEN", _data.deviceToken); | |
CloudPush.addEventListener('callback', function (evt) { | |
if (appActive) { |
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/env node | |
var util = require("util"); | |
var jediMindTrick = function(details) { | |
util.print("This is the developer you are looking for: \n"); | |
for (var key in details) { | |
if (details.hasOwnProperty(key)) { | |
util.print(key + ": " + details[key] + "\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
// Found here: https://developer.appcelerator.com/question/72361/open-pdf-file-on-android | |
try { | |
var f = Ti.Filesystem.getFile('your.pdf'); | |
Ti.Android.currentActivity.startActivity(Ti.Android.createIntent({ | |
action: Ti.Android.ACTION_VIEW, | |
type: 'application/pdf', | |
data: f.getNativePath() | |
})); | |
} |
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 pdfUrl = "http://www.irs.gov/pub/irs-pdf/fw4.pdf"; | |
Ti.Platform.openURL("https://docs.google.com/gview?embedded=true&url=" + Ti.Network.encodeURIComponent(pdfUrl)); |
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
// ---------------------------------- | |
// INIT PUBNUB | |
// ---------------------------------- | |
var pubnub = require('/lib/pubnub')({ | |
publish_key : '--PUBKEY--', | |
subscribe_key : '--SUBKEY--', | |
ssl : true, | |
origin : 'pubsub.pubnub.com' | |
}); |
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 deviceTokenSuccess(e) { | |
Ti.API.info('Device Token: ' + e.deviceToken); | |
deviceTokenLabel.text = 'Device Token:' + e.deviceToken; | |
enablePush.enabled = true; | |
var Cloud = require("ti.cloud"); | |
Cloud.PushNotifications.subscribeToken({ | |
device_token: APP.Push.deviceToken, | |
channel: "test, | |
type: Ti.Platform.name === 'android' ? 'android' : 'ios' |
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
Install required modules | |
Android - https://github.com/shivakumars/Titanium-Android-Count.ly/blob/master/dist/ly.count-android-0.1.zip | |
iOS - https://github.com/euforic/Titanium-Count.ly/blob/master/count.ly-iphone-0.2.1.zip | |
To use the modules you can use this example: | |
var countly = require('analytics'); | |
countly.event({ | |
name: 'App | Installed' | |
}); |
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
set selectedDevices to {"iPhone (Retina 3.5-inch)"} | |
if selectedDevices is not false then | |
set selectedDevice to item 1 of selectedDevices as string | |
set thePListFolderPath to path to preferences folder from user domain as string | |
set thePListPath to thePListFolderPath & "com.apple.iphonesimulator.plist" | |
tell application "System Events" | |
tell property list file thePListPath | |
tell contents | |
set value of property list item "SimulateDevice" to selectedDevice |
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
<?php | |
header('Cache-Control: no-cache, must-revalidate'); | |
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); | |
header('Content-type: application/json;'); | |
$file_array = array(); | |
if ($handle = opendir('.')) { | |
while (false !== ($entry = readdir($handle))) { |
NewerOlder