Skip to content

Instantly share code, notes, and snippets.

View santibecerra's full-sized avatar

Santiago Becerra santibecerra

  • InQBarna
  • España
View GitHub Profile
@stephenfeather
stephenfeather / parse.js
Last active May 28, 2024 15:03
Quick library for using the Parse REST API within Appcelerator's Titanium. Building it out as I need different pieces of the API.
// Copyright Stephen Feather and other contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
@aaronksaunders
aaronksaunders / post.js
Last active March 16, 2019 14:57
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" : {},
@tonylukasavage
tonylukasavage / .project
Created February 3, 2013 11:53
Proper .project file for Alloy in TiStudio, making sure all the right-click wizards for alloy are present
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>g_2tabbed</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.appcelerator.titanium.core.builder</name>
<arguments>
@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
* /
@aaronksaunders
aaronksaunders / acs_model_spec.js
Created February 8, 2013 23:16
sample test spec for testing async calls in alloy application using behave.js
//Setup module to run Behave tests
require('behave').andSetup(this);
describe('The model helper package: login USER', function() {
var ACSModels = new (require('models').MODELS)(Alloy);
it.eventually('*** logs in user', function(done) {
var model = ACSModels.createModel('user', {
@aaronksaunders
aaronksaunders / app_snippet.js
Last active July 11, 2020 14:07
One way to do bulk updates and deletes with Appcelerator Alloy Collections
// add all items to collection
Alloy.Collections.Fugitive.reset([{
"name" : "Jeff Haynie"
}, {
"name" : "Nolan Wright"
}, {
"name" : "Don Thorp"
}, {
"name" : "Marshall Culpepper"
}, {
@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
@facultymatt
facultymatt / Procfile
Created April 12, 2013 16:23
Get Deployd running on Heroku!
web: node server
@FokkeZB
FokkeZB / ALLOY.md
Last active February 13, 2019 20:01
Alloy constants and helpers for non-Alloy Titanium projects.

If you want to your CommonJS modules to work in both Alloy and plain Titanium projects, you might need a way to detect if you're in Alloy. For instance, if you're in Alloy you would get Underscore from the alloy-module, while in plain Titanium you would require Underscore directly.

Well, you can:

var _ = require((typeof ENV_TEST === 'boolean') ? 'alloy' : 'underscore')._;

The above works by utilizing Alloy's optimization process. In this process, constants like ENV_TEST will be either TRUE or FALSE. The actual expressions in wich they are used will then be evaluated. If FALSE the code block will be removed. In plain Titanium projects the constants are undefined and this typeof ENV_TEST will be undefined, so the code block will be executed.

@kwhinnery
kwhinnery / howto.md
Created May 13, 2013 00:42
Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes.

Automatic TiShadow Installs

Execute "tishadow run" in your Titanium app directory whenever a JavaScript file changes. Edit your JS files in a text editor, save, then switch to the test device or simulator. Profit.

Install supervisor

[sudo] npm install -g supervisor

Execute tishadow run anytime a JavaScript file changes