Skip to content

Instantly share code, notes, and snippets.

View marshall's full-sized avatar

Marshall Culpepper marshall

View GitHub Profile
@marshall
marshall / mozilla_profile.sh
Created June 8, 2012 19:04
mozilla_profile.sh
bz_create_patch() {
rev=HEAD^
if [ "$1" != "" ]; then
rev=$1
fi
git format-patch -k --no-stat --no-signature $rev --stdout | git patch-to-hg-patch
}
@marshall
marshall / app.js
Created October 26, 2011 19:36
V8 1.8.0 vs Rhino 1.7.3 perf results
var win = Ti.UI.createWindow({
backgroundColor: 'blue',
top: 0, left: 0, right: 0, bottom: 0
});
var view = Ti.UI.createView();
win.add(view);
var createButton = Ti.UI.createButton({
top: 0, right: 0, height: "5%",
@marshall
marshall / desktop_perf_results.txt
Created January 17, 2011 06:50
Various V8 perf test results
SunSpider tests - higher is better
Rhino (Interpreted)
-------------------
Score: 362
Richards: 425
DeltaBlue: 340
Crypto: 369
RayTrace: 535
@marshall
marshall / .bash_profile
Created December 1, 2010 17:52
Environment variables and functions that speed up testing and building Titanium Mobile
#!/bin/bash
# Add this to your ~/.bash_profile
for a in `ls $HOME/.bash_profile.d/*.sh`; do
source $a
done
marshall@snake:~/Code/test/test_python
$ python test.py
modules = set(['Android', 'Android.Calendar', 'UI', 'UI.Android']), should be: Android, Android.Calendar, UI, UI.Android
methods = set(['UI.Android.createActivity', 'UI.createLabel']), should be: UI.createLabel, UI.Android.createActivity
var db = Ti.Database.open('/sdcard/test.db');
var rs = db.execute('SELECT message FROM test');
if (rs.isValidRow()) {
alert(rs.getFieldByName("message"));
}
rs.close();
db.close();
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView label = (TextView)findViewById(R.id.TextView01);
String dbPath = "/sdcard/test.db";
SQLiteOpenHelper helper = new SQLiteOpenHelper(this, dbPath, null, 1) {
@Override
public void onUpgrade(SQLiteDatabase arg0, int arg1, int arg2) {
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := v8hi
LOCAL_CFLAGS := -I/Users/marshall/Source/v8/include -g
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -ldl -llog -L$(TARGET_OUT)
LOCAL_SRC_FILES := v8hi.cpp
PRIVATE_WHOLE_STATIC_LIBRARIES := $(TARGET_OUT)/libv8.a
// Note: this isn't public API, so there should be lots of error checking here
Method gciMethod = Resources.class.getMethod("getCompatibilityInfo");
Object compatInfo = gciMethod.invoke(view.getResources());
float appScale = (Float)compatInfo.getClass().getField("applicationScale").get(compatInfo);
<ti:app>
<!-- ... -->
<property name="ti.android.google.map.api.key.production">GET_ME_FROM_GOOGLE</property>
</ti:app>