Skip to content

Instantly share code, notes, and snippets.

View brianleroux's full-sized avatar
💚
You are now aware that you are breathing

Brian LeRoux brianleroux

💚
You are now aware that you are breathing
View GitHub Profile

PhoneGap Training Day

 9:30 - 10:30 ... intro thing (setting up, compiling, git, emulators, debugging, testing, security)    
10:30 - 10:45 ... break
10:45 - 12:30 ... tutorial thing
12:30 -  1:30 ... lunch
 1:30 -  2:30 ... apis walkthru
 2:30 -  3:30 ... phonegap futures and complimentary tools (xui, lawnchair, offline, css bs, etc, jqtouch, sencha)

3:30 - 4:30 ... open hack time

PhoneGap Training Day

 9:30 -  9:45 ... introductions
 9:45 - 10:30 ... intro to the phonegap project and mobile development (brian)
10:30 - 10:45 ... break
10:45 - 12:30 ... in depth code tutorial 
12:30 -  1:30 ... lunch
 1:30 -  2:30 ... phonegap apis walkthru, gotchas, etc

2:30 - 3:00 ... complimentary tools (xui, lawnchair)

// by way of http://dmitry.baranovskiy.com/post/typeof-and-friends
function is(o, type) {
type = String(type).toLowerCase();
return (type == "null" && o === null) ||
(type == typeof o) ||
(type == "object" && o === Object(o)) ||
(type == "array" && Array.isArray && Array.isArray(o)) ||
Object.prototype.toString.call(o).slice(8, -1).toLowerCase() == type;
}
var Person = function( name ){ this.name = name };
Person.create = function(name) { return new Person(name) };
Brian = new Person('brianleroux');
Tim = Person.create('tim');
// same fukin difference!
public class HelloWorld extends Plugin {
public PluginResult execute(String action, JSONArray args, String callbackId) {
if (action.equals("sayHello")) {
return new PluginResult(PluginResult.Status.OK, "HELLO FROM NATIVE CODES!");
}
else {
return new PluginResult(PluginResult.Status.INVALID_ACTION);
}
}
}
package comikit.droidscript;
import java.io.IOException;
import java.io.Serializable;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import org.mozilla.javascript.commonjs.module.provider.*;
import org.mozilla.javascript.ScriptRuntime;
function Person() {
// properties and validations
attr(
{ id:Number, unique:true, nullable:false },
{ email:String, unique:true, nullable:false, min:1, max:55, format:'[a-b]' },
{ salt:String },
{ pswd:String },
{ active:Boolean, init:false },
{ tags:Array }
@brianleroux
brianleroux / android-cmdline-cheatsheet.md
Created November 18, 2010 21:18
Useful command line invocations for Android with PhoneGap.
# start avd manager (create emulators, update sdks)
$ android 

# updates an android project local.properties and ant tasks
android update project -p .

# stop the server that identifies devices to ant build 
$ adb kill-server

# start up the adb server and (hopefully) find your devices!
// curl -k https://localhost:8000/
var https = require('https');
var fs = require('fs');
var options = {
key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
};
var server = https.createServer(options, function (req, res) {