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
<!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">
~/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
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
@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 ];
$('h2 a:contains("Full Example")')
.parent().hide() // headers
.next().hide() // codeblocks
// 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>')
}
@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 == "[email protected]" }
now = Time.new
@alunny
alunny / dates.rb
Created July 13, 2011 19:24
pulling times out of git
require 'time'
def all_dates filename
`git log --pretty=format:%ai #{ filename }`.split("\n")
end
def created_at filename
Time.parse all_dates(filename).last
end
<html>
<body></body>
<script src="phonegap.js"></script>
<script>
function assert(msg, booleanCondition) {
if (!booleanCondition) {
alert("assertion failed: " + msg);
return false;
} else {
return true;
@alunny
alunny / inane.txt
Created April 21, 2011 22:47
xui demo
This is some text right here