Skip to content

Instantly share code, notes, and snippets.

@nuno
nuno / loader
Created September 29, 2013 02:24 — forked from artanisdesign/loader
var CircleLoaderView = require("CircleLoaderView");
var myloader = new CircleLoaderView({
width : 200,
centerWidth : 100,
backgroundColor : "#fff",
tintColor : "blue",
textColor : "red",
labelFontSize : 28
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
var PX = require('com.pixate.framework');
PX.styleSheetFromFilePathWithOrigin({
monitor: true,
origin: 0,
filename: '/path/to/file.css'
});
PX.styleSheetFromFilePathWithOrigin({
monitor: true,
origin: 0,
filename: '/path/to/second_file.css'
@nuno
nuno / TiDocs.sh
Created November 3, 2013 12:53 — forked from eric-hu/TiDocs.sh
#! /bin/sh
# Run this from the folder you want to be the parent of your docs
# By default, generated docs go into
# titanium_mobile/dist/apidoc/ti_mobile_docs/
#
# This can be changed below
git clone https://github.com/appcelerator/titanium_mobile.git
cd titanium_mobile
sudo apt-get install python-setuptools python-dev
/**
* @aaronksaunders
*
* See more Appcelerator Information on Company Blog
* blog.clearlyinnovetiove.com
*
*/
var TiParse = function(options) {
FB = {
init: function() {
@nuno
nuno / app.js
Created November 14, 2013 16:54 — forked from aaronksaunders/app.js
Using Swipes to open and close windows in a navigation group with titanium appcelerator
//
// Aaron K. Saunders
//
// http://www.clearlyinnovative.com
// http://blog.clearlyinnovative.com
// @aaronksaunders
//
//
(function() {
var group, tab1, tab2, win1, win2;
//Application Window Component Constructor
function ApplicationWindow() {
//load component dependencies
var FirstView = require('ui/common/FirstView');
//create component instance
var self = Ti.UI.createWindow({
backgroundColor : '#ffffff',
borderRadius : 6
});
@nuno
nuno / JSStyleGuide.md
Created January 12, 2014 00:40
JS Style Guide
@nuno
nuno / app.js
Created January 12, 2014 00:45
Titanium- Control Stuff With Accelerometer
var win = Ti.UI.createWindow();
var ball = Ti.UI.createView({
backgroundColor:'blue',
height:50,
width:50,
borderRadius:20
});
win.add(ball);
@nuno
nuno / Gruntfile.js
Created January 24, 2014 02:29 — forked from gaspanik/Gruntfile.js
foundation5-grunt-watch-livereload.
/*
Foundation 5 w/ Grunt + Libsass (watch scss/*.scss & .html)
Requirement: Chrome LiveReload extension (https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei?hl=en).
Usage: foundation new project-name --libsass && grunt
*/
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),