Skip to content

Instantly share code, notes, and snippets.

View rblalock's full-sized avatar
🚀

Rick Blalock rblalock

🚀
View GitHub Profile
@jasonkneen
jasonkneen / sample.js
Last active August 29, 2015 14:01
DynamicLabel tag in Alloy - allows you to update a "value" and it applies it to a template. Place ui.js in your app/lib folder
$.recordCount.value = 99
@dylants
dylants / Gruntfile.js
Created March 26, 2014 21:50
Mocha and Jenkins integration for Titanium (Appcelerator). The titanium-tests.js contains the setup for Jenkins integration with ti-mocha (Mocha integrated into Titanium). The Gruntfile.js contains a way of monitoring for the done.testing file, which will kill the iOS simulator and allow the Jenkins build to complete.
/* global module:true */
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
watch: {
files: "done.testing",
tasks: ["shell"],
options: {
event: ["added"]
@wbroek
wbroek / genymotionwithplay.txt
Last active February 13, 2025 09:37
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
// Put me in: ~/Library/Application Support/Sublime Text 2/Packages/User/
[{
"id": "view",
"children": [{
"id": "layout",
"children": [{
"command": "set_layout",
"caption": "Custom: 3 Pane",
"mnemonic": "C",
@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 15, 2015 23:19
Android Holo Actionbar Alloy Sample Based on ideas by https://github.com/hoyo/ActionBarSample/tree/master/app
function doClickMenu(evt){
alert(evt.source.title);
}
// we need to do some things to the Window once it is properly instanciated, so we add an event listener to its OPEN event
$.win.addEventListener('open',function(){
var actionBar = $.win.activity.actionBar; // get a handle to the action bar
actionBar.title='My App'; // change the App Title
actionBar.displayHomeAsUp=true; // Show the "angle" pointing back
actionBar.onHomeIconItemSelected = function() { // what to do when the "home" icon is pressed
@tdreyno
tdreyno / gist:4947918
Created February 13, 2013 20:25
Cross-platform mouse/touch events
var evts = [],
touchEvt,
mouseEvt,
msEvent;
if (evt === 'up') {
touchEvt = 'touchend';
mouseEvt = 'mouseup';
msEvent = 'MSPointerUp';
} else if (evt === 'move') {
@grantges
grantges / alloy.js
Last active December 12, 2015 07:48
Quick code snippets to easily set up a background task to poll geolocation information on iOS on a 10 second interval
// Setup Geoloaction Background Tasks for the app
Ti.Geolocation.purpose = "This app would like to use your location.";
Ti.App.iOS.registerBackgroundService({url: "geoBackgroundTask.js"});
/**
* Note: If you are programming in a standard project for Titanium,
* this snippet would probably go in your app.js file
* /
@bhurlow
bhurlow / gist:3861616
Created October 9, 2012 21:36
Better XML to JSON parsing for cdata
// Changes XML to JSON
// fixed some bugs from http://davidwalsh.name/convert-xml-json
// October 9, 2012
// Brian Hurlow
function xmlToJson(xml) {
// Create the return object
var obj = {};
// console.log(xml.nodeType, xml.nodeName );
@Mode54
Mode54 / ActionBarView.js
Created July 22, 2012 16:00
Action Bar Module for Titanium Mobile
/*
* Android API Guide
* http://developer.android.com/guide/topics/ui/actionbar.html
* Android Design Guide
* http://developer.android.com/design/patterns/actionbar.html
* Titanium Mobile will support someday
* https://jira.appcelerator.org/browse/TIMOB-2371
*/
var osName = Ti.Platform.osname,
isAndroid = osName==='android',