Skip to content

Instantly share code, notes, and snippets.

View JigarM's full-sized avatar
🏠
Working from home

Jigar M JigarM

🏠
Working from home
View GitHub Profile
@JigarM
JigarM / app.js
Created July 4, 2013 01:29 — forked from mauropm/app.js
// INcluding memory management utils.
Ti.include('utils.js');
// root window.
var win = Ti.UI.createWindow({
backgroundColor:'white',
exitOnclose:true,
});
/**
* @aaronksaunders
*
* See more Appcelerator Information on Company Blog
* blog.clearlyinnovetiove.com
*
*/
var TiParse = function(options) {
FB = {
init: function() {
@JigarM
JigarM / app.js
Last active August 29, 2015 14:03
Codebird for Titanium Using the Twitter API Version 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);
@JigarM
JigarM / app.js
Created July 3, 2014 12:25
How Publish a Tweet (Titanium) using Codbird.js
var win = Ti.UI.createWindow();
// Main Window
var twitter = Ti.UI.createButton({
title : 'Set Tweet'
});
var accessToken = null;
var accessTokenSecret = null;
///////////LOAD ACCESS TOKEN
@JigarM
JigarM / ColorConvert.js
Last active August 29, 2015 14:03
ColorConvert.js For Titanium
var hsv2rgb = function(hsv) {
var h = hsv.hue, s = hsv.sat, v = hsv.val;
var rgb, i, data = [];
if (s === 0) {
rgb = [v, v, v];
} else {
h = h / 60;
i = Math.floor(h);
data = [v * (1 - s), v * (1 - s * (h - i)), v * (1 - s * (1 - (h - i)))];
switch(i) {
@JigarM
JigarM / thumbnail.js
Last active August 29, 2015 14:05
Titanium : Create Thumbnail Image From Video File
/**
Create Thumbnail of Video File
*/
var movie = Titanium.Media.createVideoPlayer({
contentURL:FILEURL,
movieControlStyle: Titanium.Media.VIDEO_CONTROL_EMBEDDED,
scalingMode:Titanium.Media.VIDEO_SCALING_ASPECT_FILL,
width:100,
height:100
});
@JigarM
JigarM / app.js
Last active October 26, 2015 08:32 — forked from mstepanov/app.js
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();
});
@JigarM
JigarM / Lisstview.js
Created September 18, 2014 15:46
Titanium ListView
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();
});
function Sync(model, method, opts) {
var table = model.config.adapter.collection_name, columns = model.config.columns, resp = null;
switch (method) {
case "create":
// properly set the model id on object
// and on the model.attributes notice use of 'idAttribute'
// property to account for something other than 'id' being
// used to store the actual attribute
if (!model.id) {
model.id = guid();
@JigarM
JigarM / code.m
Last active August 29, 2015 14:11
Open link in Safari
NSString *link = [NSString stringWithFormat:@"http://www.mobtwist.com"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: link]];