Skip to content

Instantly share code, notes, and snippets.

View jhaynie's full-sized avatar
🤖
making agents and stuff

Jeff Haynie jhaynie

🤖
making agents and stuff
View GitHub Profile
@jhaynie
jhaynie / app.js
Created November 29, 2010 05:31
translucent navbar
// make the contents of the window nav bar translucent like the iPhone app
var win = Titanium.UI.createWindow({barColor:"transparent",translucent:true});
@jhaynie
jhaynie / UI.as
Created November 25, 2010 07:24
Titanium.UI AS3 binding file
package Titanium
{
package UI
{
public class Window extends View
{
public native function open ( params : Object = undefined ) : void;
}
}
@jhaynie
jhaynie / app.as
Created November 25, 2010 07:17
Prototype of writing a Titanium application using ActionScript 3 natively (instead of JS).
package {
import Titanium.API;
import Titanium.UI;
/**
* Simple Titanium application written in ActionScript 3
*/
public class App
{
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Check the prerequisites for iPhone development
#
import os, sys, subprocess, re, types
import json, run, tempfile, codecs
template_dir = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename))
/**
* Simple demo for adding swipe detection on a table view row. Since the row is simply a container
* of views, you'll want to generally create a hidden view the size of the row and add your swipe listener
* to this view for detection. We need to improve Titanium so you don't have to do this in the future...
*/
var win = Ti.UI.createWindow();
var data = [];
for (var c=0;c<10;c++)
{
var message = String.format(L("format_test"),"Jeff");
alert(L("welcome"));
alert(Ti.Locale.getString("welcome"));
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="welcome">¡Hola</string>
<string name="format_test">Mi nombre es %s</string>
</resources>
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="welcome">Hello</string>
<string name="format_test">My name is %s</string>
</resources>
@jhaynie
jhaynie / logger.py
Created July 28, 2010 05:26
iPhone SDK 4.0.1 hot fix for logging issues. Drop this into your /Library/Application Support/Titanium/mobilesdk/osx/1.4.0/iphone directory
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Tail an application log file running in the iPhone Simulator
#
import os, sys, subprocess, time, signal, run, filetail
def find_file(folder, fname):
for root, dirs, files in os.walk(folder):