Skip to content

Instantly share code, notes, and snippets.

View alunny's full-sized avatar

Andrew Lunny alunny

  • Twitter
  • San Francisco, CA
View GitHub Profile
@alunny
alunny / gist:2491334
Created April 25, 2012 17:04
links from devcon5 talk
# PhoneGap Build
https://build.phonegap.com
# Slides
http://speakerdeck.com/u/alunny/p/anatomy-of-an-app
# Alex Payne: Shortchanging Your Business with User-Hostile Platforms
http://al3x.net/2011/01/15/user-hostile-platforms.html
# Tim Bray: Three Mobile Software Rules
var crypto = require('crypto'),
request = require('request'),
uri = 'https://queue.amazonaws.com/accountnumber/queuename',
qs = {
'AWSAccessKeyId': 'accesskey',
'Action': 'ReceiveMessage',
'AttributeName': 'All',
'Expires': '2012-04-22T22:52:43Z',
'MaxNumberOfMessages': '5',
'SignatureMethod': 'HmacSHA256',
@alunny
alunny / index.html
Created April 18, 2012 21:51
navigator.notification.confirm
<html>
<h1>Confirmation Test</h1>
<script src="phonegap.js"></script>
<script>
// process the confirmation dialog result
function onConfirm(button) {
alert('You selected button ' + button);
}
@alunny
alunny / index.html
Created April 13, 2012 23:37
play local audio
<html>
<h1>Playing Audio</h1>
<button onclick="playAudio('brobob.mp3')">Play Some Audio</button>
<script src="phonegap.js"></script>
<script>
function playAudio(src) {
if (device.platform == 'Android') {
src = '/android_asset/www/' + src;
}
@alunny
alunny / index.html
Created April 13, 2012 21:50
testing online/offline events
<!doctype html>
<h1>ONLINE - OFFLINE TEST</h1>
<script src="phonegap.js"></script>
<script>
document.addEventListener('online', function (e) {
alert('online event fired');
}, false)
document.addEventListener('offline', function (e) {
@alunny
alunny / config.xml
Created April 10, 2012 23:52
simple simple child browser example
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns = "http://www.w3.org/ns/widgets"
xmlns:gap = "http://phonegap.com/ns/1.0"
id = "com.alunny.chilling"
version = "1.0.0">
<name>ChildBrowser on 1.5.0</name>
<feature name="http://plugins.phonegap.com/ChildBrowser/2.0.1" />
<feature name="http://api.phonegap.com/1.0/network" />
@alunny
alunny / github.com.js
Created April 7, 2012 19:29
github++
// use with http://defunkt.io/dotjs/
$('.unread_count')
.hide()
// ignore this
// console.log('Warning: use of "phonegap.js" is deprecated in 1.5.0');
console.log('No, it\'s not');
// console.log('Please see https://build.phonegap.com/cordova for details');
console.log('Don\'t do that. There\'s nothing there');
# for good measure
@daily /etc/init.d/weinred restart
@alunny
alunny / index.html
Created February 25, 2012 00:57
simple PhoneGap File API example
<html>
<body>
<form onsubmit="return saveText()">
<label for="name">Name</label><br>
<input id="name" /><br>
<label for="desc">Description</label><br>
<input id="desc" /><br>
<input type="submit" value="Save" />