Skip to content

Instantly share code, notes, and snippets.

View zachwill's full-sized avatar

Zach Williams zachwill

View GitHub Profile
A unit test helper library for App Engine.
Note that this is currently COMPLETELY UNTESTED. Consider it demo code only.
This library aims to make it easier to unit-test app engine apps and libraries
by handling the creation and registration of service stubs and so forth for you.
It also provides a custom implementation of the Capability service that allows
you to specify what capabilities you want it to report as disabled, and it wraps
all stubs in a wrapper that will throw a CapabilityDisabledError if you attempt
to use a disabled service or method.
@ssp
ssp / nibtoxib.sh
Created December 11, 2009 11:57
nibtoxib
#! /bin/sh
find . -name "*.nib" -type d | awk '{sub(/.nib/,"");print}' | xargs -I % ibtool --write %.xib --upgrade %.nib
//
// SSMapAnnotation.h
// Public Domain
//
// Created by Sam Soffes on 3/22/10.
// Copyright 2010 Sam Soffes. All rights reserved.
//
#import <MapKit/MapKit.h>
@paulirish
paulirish / gist:366184
Created April 14, 2010 18:59
html5 geolocation with fallback.
// geo-location shim
// currentely only serves lat/long
// depends on jQuery
// doublecheck the ClientLocation results because it may returning null results
;(function(geolocation){
if (geolocation) return;
@vicalejuri
vicalejuri / django-crossdomainxhr-middleware.py
Created June 5, 2010 17:47
Middlware to allow's your django server to respond appropriately to cross domain XHR (postMessage html5 API).
import re
from django.utils.text import compress_string
from django.utils.cache import patch_vary_headers
from django import http
try:
import settings
XS_SHARING_ALLOWED_ORIGINS = settings.XS_SHARING_ALLOWED_ORIGINS
@arpit
arpit / gist:674571
Created November 12, 2010 19:50
Readability JavaScript
javascript:(function(){readConvertLinksToFootnotes=false;readStyle='style-newspaper';readSize='size-medium';readMargin='margin-wide';_readability_script=document.createElement('script');_readability_script.type='text/javascript';_readability_script.src='http://lab.arc90.com/experiments/readability/js/readability.js?x='+(Math.random());document.documentElement.appendChild(_readability_script);_readability_css=document.createElement('link');_readability_css.rel='stylesheet';_readability_css.href='http://lab.arc90.com/experiments/readability/css/readability.css';_readability_css.type='text/css';_readability_css.media='all';document.documentElement.appendChild(_readability_css);_readability_print_css=document.createElement('link');_readability_print_css.rel='stylesheet';_readability_print_css.href='http://lab.arc90.com/experiments/readability/css/readability-print.css';_readability_print_css.media='print';_readability_print_css.type='text/css';document.getElementsByTagName('head')[0].appendChild(_readability_prin

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

@tpope
tpope / css.vim
Created January 2, 2011 05:42
Nikolai's fix to nested closing curly brace indenting
" Vim indent file
" Language: CSS
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-12-22
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
@boctor
boctor / Landscape support
Created January 2, 2011 17:48
How does the Twitter iPhone App animate the current tab bar indicator? http://idevrecipes.com/2010/12/17/twitter-app-tab-bar-animation/#comment-96
- (void) addTabBarArrow
{
UIImage* tabBarArrowImage = [UIImage imageNamed:@"TabBarNipple.png"];
self.tabBarArrow = [[[UIImageView alloc] initWithImage:tabBarArrowImage] autorelease];
CGRect frame = CGRectMake([self horizontalLocationFor:0], -4, [tabBarArrow frame].size.width, [tabBarArrow frame].size.height);
[tabBarArrow setFrame:frame];
[[tabBarController tabBar] addSubview:tabBarArrow];
}
@lukaszkorecki
lukaszkorecki / example output
Created January 26, 2011 10:47
Simple Qunit test runner for PhantomJS
[10:44][~/dev/Mikrob.chrome master]: phantomjs testrunner.js file://`pwd`/test.html
Running tests
file:///Users/optimor/dev/Mikrob.chrome/test/collection_store_test.js:71 Clearing localStorage
Passed: 14, Failed: 1 Total: 15
[10:44][~/dev/Mikrob.chrome master]: echo $?
1