Skip to content

Instantly share code, notes, and snippets.

View Abizern's full-sized avatar
🎧
Working from home

Abizer Nasir Abizern

🎧
Working from home
View GitHub Profile
@Abizern
Abizern / git versioner
Created October 12, 2009 23:05
Xcode build script that adds the commit sha to the CFBundleVersion
#!/usr/bin/env ruby
# Xcode auto-versioning script for Subversion by Axel Andersson
# Updated for git by Marcus S. Zarra and Matt Long
# Converted to ruby by Abizer Nasir
# Appends the git sha to the version number set in Xcode.
# see http://www.stompy.org/2008/08/14/xcode-and-git-another-build-script/ for more details
# These are the common places where git is installed.
# Change this if your path isn't here
@Abizern
Abizern / BasicHTML5.html
Created October 28, 2009 23:10
Basic layout for HTML5
<!DOCTYPE html>
<html dir="ltr" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html;charset=utf-8" />
<title></title>
<meta name="keywords" content="" />
<meta name="robots" content="" />
@Abizern
Abizern / NSMutableDictionary+PXDictionaryAdditions.h
Created February 18, 2010 19:53 — forked from alexrozanski/NSMutableDictionary+PXDictionaryAdditions.h
NSMutableDictionary category to handle setting nil as an object for a key, adding [NSNull null] instead.
#import <Cocoa/Cocoa.h>
@interface NSMutableDictionary (PXDictionaryAdditions)
- (BOOL)setObjectOrNull:(id)anObject forKey:(id <NSCopying>)aKey;
@end
@Abizern
Abizern / CommonMacros.h
Created March 8, 2010 23:21
Common Macros for Xcode projects
// Useful Macros.
// The best place to import this is in your project's pch file.
// See http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/ for details.
// Most current version at https://gist.github.com/325926 along with usage notes.
#ifndef jcscommonmacros
#define jcscommonmacros_1_0 10000
#define jcscommonmacros jcscommonmacros_1_0
#endif
@Abizern
Abizern / gist:336603
Created March 18, 2010 17:27 — forked from Machx/gist:336563
Perl script to inject the git sha into the info.plist
HEAD=`/usr/local/bin/git rev-parse --short HEAD`
defaults write "$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH" CFBundleVersion "$HEAD"
@Abizern
Abizern / NSObject+BlockObservation.h
Created June 2, 2010 17:20 — forked from andymatuschak/NSObject+BlockObservation.h
KVO with blocks (thanks to Andy Matuschak)
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>
@Abizern
Abizern / NSArray+DSLFirstItems.h
Created October 16, 2010 13:00
Perform a block on a sequential number of objects in an array forwards or backwards.
//
// NSArray+DSLFirstItems.h
//
// Created by Pete Callaway on 15/10/2010.
// Copyright 2010 Dative Studios. All rights reserved.
// Modified by Abizer Nasir
//
#import <Foundation/Foundation.h>
@Abizern
Abizern / .gitignore
Created November 21, 2010 12:45
Global git ignore file
# Mac OS X
*.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
@Abizern
Abizern / update_git.py
Created January 11, 2011 10:25
Replace a Git installation in /usr/bin/ with symlinks to a preferred git installation.
#!/usr/bin/env python -tt
"""Xcode4 installs and expects to find a git installation at /usr/bin.
This is a pain if you want to control your own installation of git that
might be installed elsewhere. This script replaces the git files in
/usr/bin with symlinks to the preferred installation.
Update the 'src_directory' to the location of your preferred git installation.
"""
import sys
//
// NSObject+BlockObservation.h
// Version 1.0
//
// Andy Matuschak
// andy@andymatuschak.org
// Public domain because I love you. Let me know how you use it.
//
#import <Cocoa/Cocoa.h>