Skip to content

Instantly share code, notes, and snippets.

lessthanyouthink / CJProperRotationNavigationController.h
Created Oct 5, 2012
A simple UINavigationController subclass to handle iOS 6's orientation changes better.
View CJProperRotationNavigationController.h
// CJProperRotationNavigationController.h
// Created by Charles Joseph on 2012-10-01.
#import <UIKit/UIKit.h>
@interface CJProperRotationNavigationController : UINavigationController
matthewmccullough / git-deletealltags.bsh
Created Apr 1, 2011
Script to delete all tags both locally and remotely
View git-deletealltags.bsh
for t in `git tag`
git push origin :$t
git tag -d $t
View NSObject+BlockObservation.h
// NSObject+BlockObservation.h
// Version 1.0
// Andy Matuschak
// Public domain because I love you. Let me know how you use it.
#import <Cocoa/Cocoa.h>
View gist:120067
# Build an inverted index for a full-text search engine with Redis.
# Copyright (C) 2009 Salvatore Sanfilippo. Under the BSD License.
# ruby invertedindex.rb add somedir/*.c
# ruby invertedindex.rb add somedir/*.txt
# ruby search your query string
require 'rubygems'
require 'redis'
copiousfreetime / gist:59067
Created Feb 5, 2009
Postgres Partitioning with RETURNING on insert
View gist:59067
-- A method to have RETURNING work if you are partitioning data using trigger.
-- The method to this madness is:
-- 1) Use the normal trigger mechanism to insert the data into the child tables, but
-- Instead of the trigger function returning NULL so that the row does not get⋅
-- inserted into the master table, it returns the row inserted into the child
-- table
-- 2) Postgres will insert the new row from the trigger into the master table