Skip to content

Instantly share code, notes, and snippets.

View jhaynie's full-sized avatar

Jeff Haynie jhaynie

View GitHub Profile
<path>1.3.3/titanium.py create
--platform=android
--type=module
--dir=<top most folder for the project>
--name=<projectName>
--android=<android SDK path >
--id=<the project class path ie: org.appcelerator.widget>
@tzmartin
tzmartin / gist:1018258
Created June 10, 2011 05:04 — forked from omorandi/gist:1013226
Two methods for sending SMS messages with Titanium Mobile on Android throught native intents
var win1 = Titanium.UI.createWindow({
title:'Tab 1',
backgroundColor:'#fff',
layout: 'vertical'
});
var bt1 = Ti.UI.createButton({title: 'send message (method 1)', top: 200});
bt1.addEventListener('click', function(e)
@tcr
tcr / code.coffee
Created October 23, 2011 07:30
How to get started with OAuth and Github's API on node.js?
config =
key: "github_key"
secret: "github_secret"
clientID: "github_client_id"
# Network shim.
net =
post: (host, path, query, headers, data, fn) ->
headers ?= {}
@mikeyk
mikeyk / gist:1329319
Created October 31, 2011 22:56
Testing storage of millions of keys in Redis
#! /usr/bin/env python
import redis
import random
import pylibmc
import sys
r = redis.Redis(host = 'localhost', port = 6389)
mc = pylibmc.Client(['localhost:11222'])
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@edwinhuertas
edwinhuertas / app.js
Created July 8, 2012 20:05
simple iSpeech with titanium
var win = Ti.UI.createWindow({
backgroundColor: 'white',
layout:'vertical'
});
var textField = Ti.UI.createTextField({
borderStyle: Ti.UI.INPUT_BORDERSTYLE_ROUNDED,
color: '#336699',
top: 10,
left: 10,
@rborn
rborn / app.js
Created July 16, 2012 13:26 — forked from kosso/app.js
titanium tiws module example
// ****************************************************************************************************************
// ****************************************************************************************************************
// test value can be 'raw' | 'socket.io' | 'nowjs'
var test = 'raw',
// ****************************************************************************************************************
// ****************************************************************************************************************
// REMEMBER to change this with your data
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active July 24, 2024 15:28
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@mschmulen
mschmulen / SapTitanium.js
Created July 30, 2012 15:24
Connect to SAP via NetWeaver Gateway oData in a Titanium app using Appcelerator SAP Module
var uiODataSimple = (function() {
var API = {};
API.DataJS = require('ti.sap.odata');
API.collectionCache = null;
API.useXMLNotJSON = true;
API.dataType = API.useXMLNotJSON ? 'application/atom+xml' : 'application/json';
API.queryString = '=xml';
@rblalock
rblalock / alloy.js
Last active December 13, 2015 21:48
Alloy override for analytics
Alloy.createWidget = function(id, name, args) {
Ti.Analytics.featureEvent("widget." + id, args);
return new (require("alloy/widgets/" + id + "/controllers/" + (name || "widget")))(args);
};
Alloy.createController = function(name, args) {
Ti.Analytics.featureEvent("controller." + name, args);
return new (require("alloy/controllers/" + name))(args);
};