Skip to content

Instantly share code, notes, and snippets.

@soffes
soffes / install.markdown
Last active July 3, 2024 03:04
New computer setup

New Machine

Updated this for the first time in awhile in late 2020.

System Preferences

  • Enable iCloud
  • Disable iCloud mail
  • Display to medium
  • Turn up trackpad speed
@sax
sax / nginx.conf
Created September 7, 2010 22:49
unicorn + nginx on launchd
user sax staff;
worker_processes 1;
daemon off;
error_log /var/log/nginx/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
pid /var/run/nginx.pid;
@zssz
zssz / UINavigationController+Swizzle.m
Created November 19, 2010 12:20
Swizzling navbar hide methods to tackle this bug http://screenr.com/UEc - No luck.
//
// UINavigationController+Swizzle.m
//
// Created by Zsombor Szabó on 11/19/10.
// Copyright 2010 IZE. All rights reserved.
//
#import "UINavigationController+Swizzle.h"
#import <objc/runtime.h>
@jessearmand
jessearmand / mpParse.m
Created November 23, 2010 13:59
A command line tool to parse .mobileprovision file
//
// © 2008 Eugene Solodovnykov
// http://idevblog.info/mobileprovision-files-structure-and-reading/
//
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
@wooster
wooster / mobileprovision_reader.py
Created January 14, 2011 23:34
plist from .mobileprovision file
import plistlib
from StringIO import StringIO
def plist_from_mobileprovision(provision_path):
f = open(provision_path)
f.seek(62)
string = ""
lookfor = "</plist>"
found = False
while True:
@yene
yene / gist:964741
Created May 10, 2011 15:53
pre-commit hook which uses clang static analyter before commit
#!/bin/sh
RESULT=$(xcodebuild -configuration Debug RUN_CLANG_STATIC_ANALYZER=YES)
if `echo ${RESULT} | grep "generated." 1>/dev/null 2>&1`
then
echo "commit failed: anaylzer error found"
exit 1
fi
@tgaul
tgaul / InfDebugLog.h
Created June 14, 2011 19:07
InfDebugLog
#ifndef NDEBUG
#define InfDebugLog( ... ) NSLog( __VA_ARGS__ )
#else
#define InfDebugLog( ... )
#endif
#define blockSafe_cat(A, B) A##B
#define blockSafe_line(V, TMP) typeof(V) blockSafe_cat(blockSafe_tmp__, TMP) = V; __block typeof(V) V = blockSafe_cat(blockSafe_tmp__, TMP)
#define blockSafe(V) blockSafe_line(V, __LINE__)
@omz
omz / gist:1102091
Created July 24, 2011 01:40
Creating arbitrarily-colored icons from a black-with-alpha master image (iOS)
// Usage example:
// input image: http://f.cl.ly/items/3v0S3w2B3N0p3e0I082d/Image%202011.07.22%2011:29:25%20PM.png
//
// UIImage *buttonImage = [UIImage ipMaskedImageNamed:@"UIButtonBarAction.png" color:[UIColor redColor]];
// .h
@interface UIImage (IPImageUtils)
+ (UIImage *)ipMaskedImageNamed:(NSString *)name color:(UIColor *)color;
@end
@thekarladam
thekarladam / gist:1174535
Created August 26, 2011 22:04
Cocoa commandments
1. Thou shalt always use Key Value Observing
2. Thou shalt not block the main thread
3. Thou shalt compile with zero errors or warnings
4. Thou shalt use #pragma mark to separate code into groups based on related functionality