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 / adiumscript.rb
Created August 18, 2011 05:58
have adium running while I'm at work
require 'rubygems'
require 'appscript' # using 0.6.1
adium = Appscript.app "adium"
return unless adium.is_running?
accnts = adium.accounts.get
work_accnt = accnts.find { |acc| acc.name.get == "andrew.lunny@nitobi.com" }
now = Time.new
// forgive me father
if (navigator.userAgent.match("Android")) {
document.write('<script src="childbrowser-android.js"><\/script>')
} else {
document.write('<script src="childbrowser-iphone.js"><\/script>')
}
$('h2 a:contains("Full Example")')
.parent().hide() // headers
.next().hide() // codeblocks
@alunny
alunny / gist:1503552
Created December 20, 2011 22:21
Override shouldStartLoadWithRequest
/**
* Overriding in __App__Delegate.m
* if this is viable, find a nicer API and merge into PhoneGap/Callback/Cordova edge
*
* programmatic iframe creations open in main webview
* user interactions open in Safari
*/
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
BOOL superValue = [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
alunny
hey @pmuellr
pmuellr
alunny yo
pmuellr
so, my basic idea is we have two modes:
pmuellr
1) you maintain your Xcode cruft yourself - and gods help you
pmuellr
~/dev/okapi $ k db:migrate
(in /Users/alunny/dev/okapi)
rake aborted!
uninitialized constant Rake::DSL
/Users/alunny/dev/okapi/Rakefile:7
(See full trace by running task with --trace)
~/dev/okapi $ sudo gem update rake
Password:
Updating installed gems
Updating rake
<!DOCTYPE html>
<html>
<head>
<title>Test page 1</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta charset="UTF-8">
<meta name="author" content="Maciej Jaros">
<meta name="copyright" content="Maciej Jaros, Public Domain">
@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" />
# for good measure
@daily /etc/init.d/weinred restart
// 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');