Skip to content

Instantly share code, notes, and snippets.

View Machx's full-sized avatar

Colin Wheeler Machx

View GitHub Profile
@Machx
Machx / gist:1452465
Created December 9, 2011 17:23
NSNumberWithValue function overloading in C
//
// NSNumber_Extensions.h
// TouchCode
//
// Created by Jonathan Wight on 12/8/11.
// Copyright (c) 2011 TouchCode. All rights reserved.
//
#import <Foundation/Foundation.h>
@Machx
Machx / gist:1164123
Created August 23, 2011 01:49
Mask based CALayer hit testing
#import "CALayer_HitTestExtensions.h"
#import <objc/runtime.h>
static void *kHitMask;
@implementation CALayer (CALayer_HitTestExtensions)
- (NSUInteger)hitMask
{
@Machx
Machx / gist:838075
Created February 22, 2011 01:41 — forked from mikeash/gist:837409
// NSURLConnection wrapper
// like NSURLConnection, requires a runloop, callbacks happen in runloop that set up load
@interface LDURLLoader : NSObject
{
NSURLConnection *_connection;
NSTimeInterval _timeout;
NSTimer *_timeoutTimer;
NSURLResponse *_response;
long long _responseLengthEstimate;
NSMutableData *_accumulatedData;
@Machx
Machx / gist:836685
Created February 21, 2011 05:18 — forked from Abizern/gist:836472
#!/usr/bin/python
import sys
import os
from collections import defaultdict
import hashlib
theRoot = '/Volumes/Stuff/Files/'
theTrashFolder = '/Volumes/Stuff/Trash/'
#!/usr/bin/python
# Nicolas Seriot
# 2011-01-06
# https://gist.github.com/768457
"""
Input: path of an Objective-C project