Skip to content

Instantly share code, notes, and snippets.

View jhaynie's full-sized avatar

Jeff Haynie jhaynie

View GitHub Profile
<div on="click then highlight">Click me</div>
class Example
def example(arg1)
return "Hello: " + arg1.to_s
end
end
<div id="result">You should have seen a count here</div>
<script>
ti.ready(function($)
{
var db = new ti.Database
db.open("foo");
db.execute("create table if not exists Test (Phrase text, Timestamp int)");
db.execute("insert into Test values (?,?)", ["Jeff!",new Date().getTime()]);
var rs = db.execute("select count(*) from Test where Phrase like 'Jeff%'");
<input type='text' value='1' id='foo' />
<button on="click then value[id=foo,value=expr(String(parseInt($('foo').value)+10))]">Try</button>
<app:modalbox on="r:daycare.locate.by.zip.request then execute" title="Modalbox title goes here">
<app:iterator property="message" on="r:daycare.locate.by.zip.response then execute">
<html:div>#{DayCareName}</html:div>
</app:iterator>
</app:modalbox>
<script>
document.write("<div>platform name = "+Titanium.Platform.name+"</div>");
document.write("<div>platform version = "+Titanium.Platform.version+"</div>");
document.write("<div>platform architecture = "+Titanium.Platform.architecture+"</div>");
document.write("<div>platform ip_address = "+Titanium.Platform.address+"</div>");
document.write("<div>platform mac_address = "+Titanium.Platform.macaddress+"</div>");
document.write("<div>platform id = "+Titanium.Platform.id+"</div>");
document.write("<div>platform processors = "+Titanium.Platform.processorCount+"</div>");
document.write("<div>platform username = "+Titanium.Platform.username+"</div>");
document.write("<div>platform ostype = "+Titanium.Platform.ostype+"</div>");
var trayCallback = function()
{
Titanium.UI.currentWindow.setVisible(!Titanium.UI.currentWindow.isVisible());
};
var tray = Titanium.UI.addTray("app://tray.png", trayCallback);
var menu = Titanium.UI.createMenu();
menu.addItem('Reload',function() { Titanium.API.info('reload clicked'); },Titanium.UI.Android.SystemIcon.REFRESH);
Titanium.UI.setMenu(menu);
<?include_once 'facebook.php';
////////////////////////////////////////////////////////////////////////////////
// Put your app info here.
////////////////////////////////////////////////////////////////////////////////
$APP_INFO = array('api_key' => 'YOUR API KEY',
'secret' => 'YOUR API SECRET');
// create a Facebook button with a session proxy
var button = Titanium.Facebook.createLoginButton({
'id':'fb',
'style':'wide',
'apikey':'MY API KEY',
'sessionProxy':'http://my/url'
});