Skip to content

Instantly share code, notes, and snippets.

nowherenearithaca /
Last active Jul 17, 2016
css "paint-order" example

A simple example illustrating the css paint-order property.

View index.html
<!DOCTYPE html>
<meta charset="utf-8">
Hello, world!
nowherenearithaca / gist:5014255
Created Feb 22, 2013
Snippet for putting the iAd at the TOP of the screen rather than the bottom in a PhoneGap app; this is a slight tweak of the code in Scott DeSapio's note:
View gist:5014255
- (void)webViewDidFinishLoad:(UIWebView*)theWebView
// Black base color for background matches the native apps
theWebView.backgroundColor = [UIColor blackColor];
adView = [[ADBannerView alloc] initWithFrame:CGRectZero];
CGRect adFrame = adView.frame;
if([UIApplication sharedApplication].statusBarOrientation
== UIInterfaceOrientationPortrait
|| [UIApplication sharedApplication].statusBarOrientation
nowherenearithaca / MainViewController.m
Last active Dec 14, 2015
Snippet for handling external links in a PhoneGap app. I don't know the original source for this.
View MainViewController.m
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
NSURL *url = [request URL];
// Intercept the external http requests and forward to
// Otherwise forward to the PhoneGap WebView
if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) {
[[UIApplication sharedApplication] openURL:url];
return NO;
View index.html
<!DOCTYPE html>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<style type="text/css">
html, body, #map {
width: 100%;
View snippet.html
<script type="text/javascript" src=""></script>
<a href="">Reply</a>
<a href="">Retweet</a>
<a href="">Favorite</a>