Skip to content

Instantly share code, notes, and snippets.

View davejohnson's full-sized avatar

Dave Johnson davejohnson

  • Vancouver
View GitHub Profile
@davejohnson
davejohnson / cleanup
Created October 21, 2011 19:37
cleanup
#! /bin/sh
set -e
platforms=(phonegap phonegap-qt weinre mobile-spec phonegap-docs phonegap-mac phonegap-bada phonegap-wp7 phonegap-webos phonegap-blackberry-webworks phonegap-iphone phonegap-symbian.wrt phonegap-android)
for i in ${!platforms[*]}
do
# clone down the repo
git clone "git@github.com:phonegap/${platforms[$i]}.git"
@davejohnson
davejohnson / migrate.sh
Created October 21, 2011 18:09 — forked from brianleroux/migrate.sh
dont worry about it
#! /bin/sh
set -e
news=(phonegap callback-qt callback-weinre callback-test callback-docs callback-mac callback-bada callback-windows-phone callback-webos callback-blackberry)
olds=(phonegap phonegap-qt weinre mobile-spec phonegap-docs phonegap-mac phonegap-bada phonegap-wp7 phonegap-webos phonegap-blackberry-webworks)
for i in ${!olds[*]}
do
# clone down the old repo
git clone "http://github.com/phonegap/${olds[$i]}"
function Cache() { }
Cache.prototype.getCachedPathForURI = function(uri, success, fail) {
return PhoneGap.execAsync(function(args) {
success(uri, args.file);
}, function(args) {
fail(uri, args.message);
}, 'com.example.URLCache', 'getCachedPathForURI', [uri, 'FOO']);
};
@davejohnson
davejohnson / Android-plugin-java-example
Created September 3, 2010 22:21
phonegap-android-plugin-java-example
package com.example;
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
/**
* Creates an event object.
* @class ChannelChannel class is used for attaching
* event handlers to JavaScript objects.
* <pre class="code">
* &#102;unction handleEvent(eventArgs) {
* // Do something with the event arguments...
* }
*
* var onItemSelected = new Channel();
package com.example;
import java.util.Arrays;
import java.util.Iterator;
public class JavaSparseArray implements Iterable<SparseArrayTuple>, Iterator<SparseArrayTuple> {
private int[][] Avalue;
private int[][] Aindex;
private int columnCount;
[] == false; // true
"" == false; // true
null == false; // false, that's more like it