Skip to content

Instantly share code, notes, and snippets.

View nuno's full-sized avatar

Nuno Costa nuno

View GitHub Profile
@nuno
nuno / app.js
Last active August 29, 2015 14:20 — forked from mstepanov/app.js
Titanium ListView Examples
var rootWin = Ti.UI.createWindow();
var navGroup = Ti.UI.iPhone.createNavigationGroup({
window: rootWin
});
var button = Ti.UI.createButton({
title: 'Open ListView Tests'
});
button.addEventListener('click', function() {
openTestsWindow();
});
@nuno
nuno / Get Total Shares (returns JSON)
Last active September 30, 2019 23:37 — forked from teybannerman/Get Total Shares (returns JSON)
AddThis Public sharing endpoints & API URL to retrieve total share count for any given URL
http://api-public.addthis.com/url/shares.json?url=http%3A%2F%2Fwww.twitter.com
@nuno
nuno / _ReadMe.md
Last active August 29, 2015 14:18 — forked from aaronksaunders/_ReadMe.md
Alternate Implementation Appcelerator Titanium Models/Collections

Implementing Appcelerator Titanium Models/Collections for Cloud Services without all the extra files

It is a PITA working with Appecelerator Alloy Models and Collection because you need to create these template files for everything, even of you are not using them. This is a "HACK" that I came up with after a few hours that appears to address the issue.

I am certain that there might be a cleaner way, which would require deeper understand of the underpinnings of Alloy, maybe someone can make a suggestion, maybe it will come to me later.

###Notes This code is using a ACS Sync Adapter customize for cloud services with promises integration

https://github.com/aaronksaunders/Appcelerator-Cloud-Services-Sync-Adapter

@nuno
nuno / shortExample.js
Last active March 15, 2017 18:50 — forked from bender-rulez/shortExample
Twitter like image dismiss Titanium
var fadeIntro = Titanium.UI.createAnimation();
fadeIntro.opacity = 1.0;
fadeIntro.duration = 250;
var fadeOutro = Titanium.UI.createAnimation();
fadeOutro.opacity = 0.0;
fadeOutro.duration = 250;
var fadeOutSlow = Titanium.UI.createAnimation();
@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)
@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);