Skip to content

Instantly share code, notes, and snippets.

Patrick Hughes phughes

Block or report user

Report or block phughes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@phughes
phughes / NSDateFormatter+fbsThreadSafeFormatter.h
Created Sep 9, 2013
A thread safe way to parse dates with arbitrary formats. NSDateFormatter is not thread safe. This method keeps a collection of formatters, one per thread per format, and creates/returns them in a thread safe manner. Caching formatter objects results in a significant speed improvement. On the simulator (2.4Ghz i5) we see the following numbers: Fo…
View NSDateFormatter+fbsThreadSafeFormatter.h
//
// NSDateFormatter+fbsThreadSafeFormatter.h
// NSDateAdditions
//
// Created by Patrick Hughes on 3/3/13.
// Copyright (c) 2013 Patrick Hughes. All rights reserved.
//
#import <Foundation/Foundation.h>
@phughes
phughes / image.py
Last active Dec 10, 2015
An Xcode precompilation script to turn your images into auto-completeable, type-checkable symbols.
View image.py
import os.path as path
import string
import argparse
import glob
import re
def basename(filename):
base = filename
if filename.find('@2x') > 0:
base = filename[:filename.find('@2x')]
You can’t perform that action at this time.