Skip to content

Instantly share code, notes, and snippets.

@alanthonyc
alanthonyc / debuglog_macro.h
Created January 11, 2012 02:50
Debug Log Macro for iOS (pulled from zonque's code)
#ifdef ENABLE_DEBUG
#define DebugLog(format, args...) \
NSLog(@"%s, line %d: " format "\n", \
__func__, __LINE__, ## args);
#else
#define DebugLog(format, args...) do {} while(0)
#endif
// sample use
DebugLog("number: %d ; class %p", count, className);
@alanthonyc
alanthonyc / plist_template.m
Created December 5, 2011 19:02
Objective-C Scratchpad - a bunch of random stuff
// read plist
NSString *errorDesc = nil;
NSPropertyListFormat format;
NSString *plistPath;
NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
plistPath = [rootPath stringByAppendingPathComponent:@"Pexplorer.plist"];
NSString *originalPlistPath;
originalPlistPath = plistPath;
@alanthonyc
alanthonyc / .bashrc_auto_virtualnv
Created June 27, 2011 11:30
.bashrc to auto activate a virtualenv
# from kencochrane.net
emacs /opt/django/.bashrc
#
# User specific aliases and functions
has_virtualenv() {
if [ -e .venv ]; then
deactivate >/dev/null 2>&1
source bin/activate
fi