Skip to content

Instantly share code, notes, and snippets.

Codeboxed codeboxed

Block or report user

Report or block codeboxed

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@codeboxed
codeboxed / FileUtils.js
Created Mar 5, 2011
Copy files from a source to a target using Titanium as a platform
View FileUtils.js
/**
* Class name: FileUtils.js
* Author: Codeboxed
* URL: http://www.codeboxed.com
* Date: March 5, 2011
* Platform: Titanium
*/
var FileUtils = function (){
@codeboxed
codeboxed / index.html
Created Mar 5, 2011
Download script using Titanium API
View index.html
<html>
<head></head>
<body style="background-color:#1c1c1c;margin:0">
<div style="border-top:1px solid #404040">
<div style="color:#fff;;padding:10px">Welcome to Titanium</div>
</div>
<script type="text/javascript">
var url = 'http://www.codeboxed.com';
// Initialize the HTTPClient object
@codeboxed
codeboxed / database.js
Created Mar 5, 2011
Connect with Titanium to your databases
View database.js
/**
* Class name: database.js
* Author: Codeboxed
* URL: http://www.codeboxed.com
* Date: March 5, 2011
* Platform: Titanium
*/
var database = function(dbName, table){
@codeboxed
codeboxed / example.js
Created Mar 5, 2011
Example on how to set the file path for embedding videos on Mac OS X and Windows with Titanium
View example.js
var filesPath = Titanium.API.application.dataPath +
Titanium.Filesystem.getSeparator();
var currentFile = 'file.mp4';
var filePath = null;
switch(Titanium.getPlatform()) {
// Apple
case 'osx':
filePath = "file:///" + filesPath + currentFile;
break;
@codeboxed
codeboxed / index.html
Created Mar 5, 2011
Download remote files async with Titanium
View index.html
<html>
<head></head>
<body style="background-color:#1c1c1c;margin:0">
<div style="border-top:1px solid #404040">
<div style="color:#fff;;padding:10px">Welcome to Titanium</div>
</div>
<script type="text/javascript">
localFile = Titanium.Filesystem.getDesktopDirectory().toString() +
Titanium.Filesystem.getSeparator() +
@codeboxed
codeboxed / Preferences.js
Created Mar 5, 2011
Preferences class for storing/retrieving Titanium.App.Properties
View Preferences.js
/**
* Class name: Preferences.js
* Author: Codeboxed
* URL: http://www.codeboxed.com
* Date: March 7, 2011
* Platform: Titanium
*/
var Preferences = function() {
// Private
@codeboxed
codeboxed / index.html
Created Mar 26, 2011
Titanium Desktop event listeners
View index.html
<html>
<head></head>
<body style="background-color:#1c1c1c;margin:0">
<div style="border-top:1px solid #404040">
<div style="color:#fff;;padding:10px">Welcome to Titanium</div>
</div>
<script type="text/javascript">
var eventName = 'randomEvent';
@codeboxed
codeboxed / youtube_videos_example.js
Created May 4, 2011
Show YouTube videos with Titanium mobile
View youtube_videos_example.js
var win = Ti.UI.currentWindow;
// Set the window orientation modes for the video to rotate with the device
win.orientationModes = [ Ti.UI.PORTRAIT, Ti.UI.LANDSCAPE_LEFT,
Ti.UI.LANDSCAPE_RIGHT ];
// Build the movie URL. 'fs' and 'autoplay' parameters are optional.
var movieId = "d0llSyfgwEE";
var movieUrl = "http://www.youtube.com/embed/" + movieId+ "?fs=1&autoplay=1";
View plist-to-json.js
/**
* Class name: PlistToJson
* Author: Codeboxed
* URL: http://www.codeboxed.com
* Date: May 10, 2011
* Platform: Titanium
*/
var PlistToJson = function() {
/**
@codeboxed
codeboxed / database.js
Created Jun 6, 2011
Titanium Mobile Database Class
View database.js
/**
* Class name: database.js
* Author: Codeboxed
* URL: http://www.codeboxed.com
* Date: June 6, 2011
* Platform: Titanium
*/
var Database = function(dbPath, dbName, table, tableFields){
You can’t perform that action at this time.