Skip to content

Instantly share code, notes, and snippets.

mitchell amihod meeech

Block or report user

Report or block meeech

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
View ui.lua
UI = {}
local FONT = 'OCRAStd'
function UI.counter(label, counter)
local group = display.newGroup()
local lText, lSize = label.text, label.size or 25
local cText, cSize = counter.text, counter.size or lSize
View gist:5671871
/**
* RULES:
* PAUSE event always seems to remember the last URL value
* So, if you launch app with URL, then PAUSE, getArgs will still have URL in it
* Same for if you pause app,
* resume it with a URL, then pause, same thing - it remains the first time.
* Incoming query string values should be encoded according to http://www.faqs.org/rfcs/rfc3986.html
* (basically, php rawurlencode)
*/
@meeech
meeech / gist:5407137
Created Apr 17, 2013
Test using Ti.App events vs using JS only event system.
View gist:5407137
var win = Ti.UI.createWindow({backgroundColor: '#fff'})
, Emitter = require('emitter') //https://github.com/component/emitter
, event = new Emitter()
, limit = 10000
, i = 0
, startTime
;
var buttonTi = Ti.UI.createButton({title: 'start-Ti', left: 10});
var buttonJs = Ti.UI.createButton({title: 'start-js', right: 10});
View db.js
//Simple k/v
//Open the db.
//DB is simple k/v
var db = Ti.Database.open('db');
// db.execute('DELETE FROM DATA');
// db.execute('DROP TABLE DATA');
// db.execute('VACUUM');
db.execute('CREATE TABLE IF NOT EXISTS DATA (KEY TEXT UNIQUE, VALUE TEXT)');
// var xo = db.execute('SELECT * FROM DATA');
@meeech
meeech / gist:4724807
Created Feb 6, 2013
work around the fact you can't show/hide buttons in a toolbar on ios w/ titanium. So this manages the toolbar for portrait/landscape mode of the detail window in a split view.
View gist:4724807
//So, grab the toolbar items.
//Its set up for portrait by default
var tbButtons = $.toolbar.items
, showMasterViewButton = tbButtons[0] //cache a copy
;
//For first run if launched in landscape mode
if(Ti.Gesture.isLandscape()) {
tbButtons.shift();
$.toolbar.items = tbButtons;
@meeech
meeech / app.js
Created Oct 16, 2012 — forked from nauman/app.js
Titanium header - > title, content -> table, footer -> banner
View app.js
Ti.UI.setBackgroundColor('#000');
var win = Ti.UI.createWindow({
backgroundColor: 'red',
exitOnClose: true,
navBarHidden: true
});
var titleView = Ti.UI.createView({
backgroundColor: '#f00',
top: 0,
@meeech
meeech / gist:3894108
Created Oct 15, 2012
sidemenu distilled
View gist:3894108
//Barebones example of how we do sidemenu in iOS app.
//You use this window as the container for your navGroup.
var rootWin = Titanium.UI.createWindow({
zIndex: 2,
width: '100%',
backgroundColor: '#f00',
listPanelVisible: false //Custom prop
});
View app.js & countdown.js
//app.js
Titanium.UI.setBackgroundColor('#000');
//create window
var win = Titanium.UI.createWindow({
title:'Countdown Main',
modal: true,
exitOnClose: true
});
View gist:3708245
//Simple k/v
//Open the db.
//DB is simple k/v
var db = Ti.Database.open('db');
// db.execute('DELETE FROM DATA');
// db.execute('DROP TABLE DATA');
// db.execute('VACUUM');
db.execute('CREATE TABLE IF NOT EXISTS DATA (KEY TEXT UNIQUE, VALUE TEXT)');
// var xo = db.execute('SELECT * FROM DATA');
View gist:3703306
#!/usr/bin/ruby
require 'socket'
require 'rubygems'
require 'json'
require 'listen'
path = '/Users/mitch/Sites/klocko'
Listen.to(path, :force_polling => true) do |modified, added, removed|
You can’t perform that action at this time.