Skip to content

Instantly share code, notes, and snippets.

View michelmelo's full-sized avatar
🍷
wine

Michel Melo michelmelo

🍷
wine
View GitHub Profile
/**
Create Thumbnail of Video File
This snippet captures a thumbnail JPG image, based on a frame @ 2 second time-lapse.
Titanium Mobile
*/
var movie = Titanium.Media.createVideoPlayer({
contentURL:FILENAME,
@michelmelo
michelmelo / app.js
Created July 23, 2013 08:22 — forked from pec1985/app.js
/**
* To be used this way
*/
var Log = require('log');
Log.Info('This is an info log');
Log.Error('This is an error log');
Log.Debug('This is a debug log');
@michelmelo
michelmelo / app.js
Created July 23, 2013 08:21 — forked from pec1985/app.js
var win = Ti.UI.createWindow();
var images = [];
for(var i = 1; i < 100; i++){
// Assuming all the images are called image1.jpg, image2.jpeg, etc...
images.push('/images/image'+i+'.jpg');
}
var gallery = Gallery(images,0);
var win = Ti.UI.createWindow({
backgroundColor: '#333'
});
var menuWidth = 200;
var container = Ti.UI.createScrollView({
disableBounce: false,
horizontalBounce: true,
contentWidth: Ti.Platform.displayCaps.platformWidth + menuWidth
/*
State.
*/
var simplify = Ti.Platform.osname === 'mobileweb';
var currentFlashes = {};
/*
Public API.
*/
exports.chainAnimateForever = chainAnimateForever;
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var imgTableLoco = Ti.UI.createTableView({
width: 270,
height: 290,
top: 0,
backgroundColor: 'black'
});
/**
*
* this code was inspired by the work done by David Riccitelli
*
* Copyright 2011 Aaron K. Saunders, Clearly Innovative Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
//"THE BEER-WARE LICENSE": As long as you retain this notice you can do whatever you want with this stuff.
//If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Jamie Buckley
var screenWidth = Ti.Platform.displayCaps.platformWidth;
var screenHeight = Ti.Platform.displayCaps.platformHeight;
var win = Ti.UI.createWindow({
fullscreen: true,
width: screenWidth,
height: screenHeight,
@michelmelo
michelmelo / app.js
Created July 23, 2013 08:14 — forked from pec1985/app.js
function PassCode(_params){
_params = _params || {};
// @PARAMS:{
// boxSize: (Number) size of the passcode character boxes
// backgroundColor: (String) background color of the mainview
// backgroundImage: (String) background image of the mainview
// panicColor: (String) background color of the view when panic() is called - when wrong password
// titleText: (String) the text of the title view, above the pass code boxes by default,
// mainView: (Object) params for the main view that hold the passcode boxes
@michelmelo
michelmelo / app.js
Created September 24, 2012 11:53 — forked from KarthiPnsmy/app.js
Create Album and Post Photos in Facebook Using Appcelerator Titanium
// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');
//FACEBOOK CREDENTIAL
Titanium.Facebook.appid = "134793934930";
Titanium.Facebook.permissions = ['publish_stream', 'read_stream'];
//
// create root window