Skip to content

Instantly share code, notes, and snippets.

View HazemKhaled's full-sized avatar

Hazem Khaled HazemKhaled

View GitHub Profile
@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"
}, {
@DianthuDia
DianthuDia / ActionBarView.js
Created November 12, 2012 16:46 — forked from Mode54/ActionBarView.js
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',
@pedrofaria
pedrofaria / sqlx.js
Created October 6, 2012 22:08
New adapter for alloy models
/*
* Local SQLite sync adapter which will store all models in
* an on device database
*/
var _ = require('alloy/underscore')._,
db;
function S4() {
return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
};
@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',
@xalakox
xalakox / couchdb csv list
Created June 30, 2012 23:28
CouchDB JSON to CSV view converter use ?include_docs=true&reduce=false
{
"csv":"function(head, req){
start({
'headers': {
'Content-Type': 'text/csv'
}
});
Array.prototype.unique = function() {
var a = this.concat();
function CustomImageView(args) {
var self = Ti.UI.createImageView(args);
//override any customizations to image, images, repeatCount, or duration
self.image = args.animatedImages[0];
self.repeatCount = null;
self.duration = null;
//instance variables
var animationIndex = 0,
animationCount = 0,