Skip to content

Instantly share code, notes, and snippets.

View johankool's full-sized avatar

Johan Kool johankool

View GitHub Profile
#
# Set the build number to the current git commit count.
# If we're using the Dev scheme, then we'll suffix the build
# number with the current branch name, to make collisions
# far less likely across feature branches.
# Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/
#
git=`sh /etc/profile; which git`
appBuild=`"$git" rev-list --all |wc -l`
if [ $CONFIGURATION = "Debug" ]; then
@johankool
johankool / gist:1874995
Created February 21, 2012 07:58
Useful macros dealing with nil and NSNull
#define NILIFNULL(foo) ((foo == [NSNull null]) ? nil : foo)
#define NULLIFNIL(foo) ((foo == nil) ? [NSNull null] : foo)
#define EMPTYIFNIL(foo) ((foo == nil) ? @"" : foo)
@johankool
johankool / NSData+Hex.h
Created December 7, 2011 16:26
Get a string representation of your NSData with or without spaces or capitals
//
// NSData+Hex.h
//
// Based on code by AliSoftware
// http://stackoverflow.com/a/7520723/60488
//
#import <Foundation/Foundation.h>
@interface NSData (Hex)
@johankool
johankool / NSURL+PathParameters.h
Created October 1, 2011 17:21
NSURL+PathParameters
//
// NSURL+PathParameters.h
//
// Created by Johan Kool on 27/9/2011.
// Copyright 2011 Koolistov Pte. Ltd. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this list of
@johankool
johankool / KVStylesheet.m
Created April 18, 2011 05:32
Alternative approach to have consistent UILabel styling.
//
// KVStylesheet.m
// Koolistov
//
// Created by Johan Kool on 15-04-2011.
// Copyright 2011 Koolistov. Use as you desire.
//
#import "KVStylesheet.h"