Skip to content

Instantly share code, notes, and snippets.

// 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({
@jeffatstepup
jeffatstepup / passwalletIntent.js
Created February 17, 2015 10:18
How to open pkpass files in PassWallet from Appcelerator Titanium
/**
*
* Save pkpass to PassWallet
* See http://passwallet.attidomobile.com/PassWallet%20Developer%20Guide.pdf
*
*/
function shareToPassWallet () {
var pkpassFile,
intent,
@muka
muka / notification.js
Last active August 25, 2017 02:51
titanium android, pass extras from a notification to main app
/**
* @see https://gist.github.com/muka/d4afae20a5732f3937e8
*/
var notificationCounter = 0;
module.exports.launch = function(options) {
options = options || {};
if( !options.contentTitle ||
@joshjensen
joshjensen / alloy.py
Last active November 30, 2016 18:25
Alloy Grid - Open Alloy controllers, views, and styles in Sublime Text grid layout.
# 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...
@sharpred
sharpred / gist:13cda452cab8348ef635
Created June 5, 2014 09:55
performs jshint on files in your commit
#!/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"
@FokkeZB
FokkeZB / IMPORT.md
Last active May 24, 2023 21:24
Add support for @import to Alloy styles

@import TSS for Alloy

NOTE: This is out-dated, I suggest using https://github.com/dbankier/ltss instead.

This alloy.jmk adds support for using CSS-like @import "file.tss"; statements in Alloy TSS styles.

The idea for this came when discussing adding the option of including a CSS-like reset stylesheet in Alloy to make up for platform differences in (background)color, but also some good practices.

I think one of the key issues in this discussion is that there is no such thing as the base style for an app. iOS fans would like to reset to iOS-like styles, Android fans like to reset to theirs, flat UI fanatics would like everything minimalized and Bootstrap adepts will ask for a huge library of styles.

@viezel
viezel / app.js
Last active June 15, 2020 19:13
Codebird for Appcelerator Titanium. Using the Twitter API 1.1
// This is an example of use.
// Here we use the new Bearer Token thats make it possible to get tweets without user login
// More info on Bearer here: https://dev.twitter.com/docs/auth/application-only-auth
// Full Codebird API is here: https://github.com/mynetx/codebird-js
var Codebird = require("codebird");
var cb = new Codebird();
cb.setConsumerKey('CONSUMER_KEY', 'CONSUMER_SECRET_KEY');
var bearerToken = Ti.App.Properties.getString('TwitterBearerToken', null);
@jasonkneen
jasonkneen / 1readme.md
Last active May 28, 2021 16:48
Quick example of registering a URLScheme in a Titanium app using the TiApp.xml without info.plist file. Just add the following into your TiApp.xml (I put it under the </iphone> tag. Works on Android and iOS.

Quick Example of registering a scheme in TiApp.xml, implementing the code in app.js / alloy.js

@ricardoalcocer
ricardoalcocer / index.js
Last active December 16, 2015 16:29
Quick and dirty Appcelerator Alloy + FireFoxOS hack. This sample App works EXACTLY the same on iOS, Android and FirefoxOS.
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();
@return1
return1 / trim_enabler.txt
Last active August 25, 2023 02:59
TRIM Enabler for OS X Yosemite 10.10.3
#
# UPDATE for 10.10.4+: please consider this patch obsolete, as apple provides a tool called "trimforce" to enable trim support for 3rd party SSDs
# just run "sudo trimforce enable" to activate the trim support from now on!
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/