Skip to content

Instantly share code, notes, and snippets.

@nowherenearithaca
nowherenearithaca / .block
Last active September 18, 2016 17:54
iris demo
license: mit
license: mit
@nowherenearithaca
nowherenearithaca / README.md
Last active July 17, 2016 01:45
css "paint-order" example

A simple example illustrating the css paint-order property.

<!DOCTYPE html>
<meta charset="utf-8">
Hello, world!
@nowherenearithaca
nowherenearithaca / gist:5014255
Created February 22, 2013 15:34
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: http://engineering.scottdesapio.com/2013/02/add-iad-to-phonegap-application.html
- (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
nowherenearithaca / MainViewController.m
Last active December 14, 2015 02:29
Snippet for handling external links in a PhoneGap app. I don't know the original source for this.
- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
NSURL *url = [request URL];
// Intercept the external http requests and forward to Safari.app
// Otherwise forward to the PhoneGap WebView
if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) {
[[UIApplication sharedApplication] openURL:url];
return NO;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?1.29.1"></script>
<style type="text/css">
html, body, #map {
width: 100%;
@nowherenearithaca
nowherenearithaca / snippet.html
Last active December 11, 2015 23:59
Snippet for blog
<script type="text/javascript" src="https://platform.twitter.com/widgets.js"></script>
<a href="https://twitter.com/intent/tweet?in_reply_to=51113028241989632">Reply</a>
<a href="https://twitter.com/intent/retweet?tweet_id=51113028241989632">Retweet</a>
<a href="https://twitter.com/intent/favorite?tweet_id=51113028241989632">Favorite</a>