Skip to content

Instantly share code, notes, and snippets.

View nuno's full-sized avatar

Nuno Costa nuno

View GitHub Profile
@nuno
nuno / ImageProcessor.js
Last active August 29, 2015 14:13 — forked from stephenfeather/ImageProcessor.js
Module that uses the ti.imagefactory module to resize images.
/*jslint vars: true, sloppy: true, nomen: true, maxerr: 1000 */
function ImageProcessor(imagePath){
//if (Ti.App.Properties.getInt('CompressImages') === 1){
var ImageFactory = require('ti.imagefactory');
Ti.API.info('Compressing and Resizing Image');
var tempFile = Ti.Filesystem.getFile(imagePath);
var imageBlob = tempFile.read();
@nuno
nuno / genymotionwithplay.txt
Last active August 29, 2015 14:13 — forked from wbroek/genymotionwithplay.txt
Genymotion with 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 5.1 (https://www.androidfilehost.com/?fid=96042739161892865 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23501681358544845 - gapps-kk-20140606-signed.zip)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
alias geny-n5='ti build -p android --device-id "Nexus 5 - 4.4.2 - API 19 - 1080x1920"'
alias geny-n4='ti build -p android --device-id "Nexus 4 - 4.2.2 - API 17 - 768x1280"'
alias geny-n5s='ti build -p android --device-id "Nexus 5 - 4.4.2 - API 19 - 1080x1920" --shadow'
alias geny-n4s='ti build -p android --device-id "Nexus 4 - 4.2.2 - API 17 - 768x1280" --shadow'
alias shadow-iphone='ti build -p iphone -I 7.1 --retina --tall --shadow'
## xCode 6 and iOS 8 commands
alias iphone4s='ti build -p ios -C 85403F52-1516-424E-B60A-5A8532A3C381'
alias iphone4s-shadow='ti build -p ios -C 85403F52-1516-424E-B60A-5A8532A3C381 --shadow'
@nuno
nuno / post.js
Last active August 29, 2015 14:12 — forked from aaronksaunders/post.js
Start of rest adapter for Appcelerator Alloy & sample model file
//
// blog.clearlyionnovative.com
// twitter: @aaronksaunders
//
// Model file for integration Appcelerator Titanium Alloy with Wordpress JSON Plugin
//
exports.definition = {
config : {
"columns" : {},
@nuno
nuno / app.js
Last active August 29, 2015 14:10 — forked from aaronksaunders/app.js
Integrating ACS with NODE JS - This works, BUT I want to migrate it to using the new Node.ACS platform
// SEE QUESTION IN QA FORUM
// http://developer.appcelerator.com/question/142378/integrating-nodeacs-with-expressjs-not-working
// @aaronksaunders
//
/**
* Module dependencies.
*/
var express = require('express');
// 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",
@nuno
nuno / app.js
Created September 13, 2014 12:21 — forked from viezel/app.js
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);
@nuno
nuno / index.js
Created August 19, 2014 01:51 — forked from jasonkneen/index.js
Demonstrate CollapsableView Tag in Alloy.
function collapse(){
$.myView.collapse();
// $.myView.expand();
}
@nuno
nuno / index.js
Created August 19, 2014 01:47 — forked from rborn/index.js
Demo of how to use David Bankier's "Real Switch" for Android here. https://github.com/dbankier/RealSwitch. Add the Module to your TiApp.xml file, add a switch to your Alloy file as normal, but add the module attribute. Drop the ui.js file into your /lib/ folder (you can add to this) and then run the project. On iOS you'll get a regular iOS switc…
$.mySwitch.addEventListener('change',function(e){
Ti.API.info('Switch value: ' + $.mySwitch.value);
});
@nuno
nuno / singletap.js
Created August 15, 2014 13:42 — forked from FokkeZB/singletap.js
Snippet from Blain Hamon on how to prevent Titanium from queing up multiple tap events
function handleOnce(funct) {
var flag = false;
return function(e) {
if (flag) return;
flag = true;
setTimeout(function() {
flag = false;
}, 0);
funct(e);