Skip to content

Instantly share code, notes, and snippets.

View tjw's full-sized avatar

Timothy J. Wood tjw

View GitHub Profile
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@interface ExtraData : NSObject
@end
@implementation ExtraData
- (void)dealloc;
{
fprintf(stderr, "ExtraData %p deallocated\n", self);
[super dealloc];
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <objc/objc-auto.h>
/*
cc -Wall -fobjc-gc objc-assoc.m -o objc-assoc -framework Foundation
*/
@interface ExtraData : NSObject
@end
#import <stdio.h>
#import <dispatch/dispatch.h>
#import <libkern/OSAtomic.h>
#import <unistd.h>
/*
gcc-4.2 -arch x86_64 -std=gnu99 -O0 -mdynamic-no-pic -Wall -Werror -isysroot /Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -gdwarf-2 max-concurrent.c -o max-concurrent
*/
int main(int argc, char *argv[])
[OUIAnimationSequence runWithDuration:0.3
actions:
^{
// step 1
},
^{
// step 2
},
^{
@tjw
tjw / PackageSystemHeaders
Created February 25, 2011 00:40
Go beyond the release notes!
#!/bin/zsh -f
set -e
PKG_DIR=/tmp/SystemHeaders-`uname -r`
echo "Packaging $PKG_DIR..."
mkdir -p $PKG_DIR
cd /
for d in System/Library/Frameworks usr/include Developer/Library/Frameworks usr/lib; do
static id _commonInit(MyView *self)
{
// common init stuff like so...
self.opaque = YES;
self->_scale = 1.0;
return self;
}
- initWithFrame:(CGRect)frame;
--------------- cats #42 (34 lines) ---------------
Date: Fri Apr 22 12:33:02 1994
From: I'm jealous of Le Qow. <camel>
Subject: cat humor
recent cat humor postings on the uwbb reminded me of Yak.
Just for some reminiscing, here's a yak post that I've saved for quite
some time now.
Marker - Apr 27, 2012 10:41:55 PM
Apr 27 22:41:58 vaya [0x0-0x61f61f].com.wb.Bastion[17401]: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object
Apr 27 22:41:58 vaya [0x0-0x61f61f].com.wb.Bastion[17401]: at GSGE.AppDelegate.DidBecomeActive (MonoMac.Foundation.NSNotification) <0x00010>
Apr 27 22:41:58 vaya [0x0-0x61f61f].com.wb.Bastion[17401]: at (wrapper dynamic-method) object.[GSGE.AppDelegate.Void DidBecomeActive(MonoMac.Foundation.NSNotification)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSNotification) <0x00033>
Apr 27 22:41:58 vaya [0x0-0x61f61f].com.wb.Bastion[17401]: at (wrapper native-to-managed) object.[GSGE.AppDelegate.Void DidBecomeActive(MonoMac.Foundation.NSNotification)] (MonoMac.Foundation.NSObject,MonoMac.ObjCRuntime.Selector,MonoMac.Foundation.NSNotification) <0x000fb>
Apr 27 22:41:58 vaya [0x0-0x61f61f].com.wb.Bastion[17401]: at (wrapper managed-to-native) MonoMac.AppKit.NSApplication.NSApplicationMain
#import <stdio.h>
#define UNIQUE_CONST_PTR2(X) ({ static unsigned X; &X; })
#define CAT(x,y) x##y
#define UNIQUE_CONST_PTR1(X, Y) UNIQUE_CONST_PTR2(CAT(X,Y))
#define UNIQUE_CONST_PTR(KEY) UNIQUE_CONST_PTR1(KEY, __COUNTER__)
int main(int argc, char *argv[])
{
const void *u1 = UNIQUE_CONST_PTR(A);
@tjw
tjw / gist:4506724
Last active December 10, 2015 23:08
2013-01-10 15:34:16.892 otest[1587:7407] NSFileCoordinator: Sending of a willWrite message was interrupted. Details: Connection interrupted
2013-01-10 15:34:16.892 otest[1587:7407] A process invoked one of the -[NSFileCoordinator coordinate...] methods but filecoordinationd crashed. Returning an error.
(gdb) bt
#0 0x00007fff8d9cc250 in objc_msgSend ()
#1 0x0000000000000030 in ?? ()
#2 0x00007fff95bc50af in -[NSFileSubarbitrationClaim devalueSelf] ()
#3 0x00007fff95bc4eef in -[NSFileSubarbitrationClaim revoked] ()
#4 0x00007fff95bb07d9 in -[NSFileAccessArbiter _revokeAccessClaim:] ()
#5 0x00007fff95bb0896 in -[NSFileAccessArbiter _revokeAccessClaimForID:fromLocal:] ()