Skip to content

Instantly share code, notes, and snippets.

View tjw's full-sized avatar

Timothy J. Wood tjw

View GitHub Profile
{
"graph" : {
"title" : "OmniPresence",
"datasequences" : [
{
"title" : "Hours per Crash",
"datapoints" : [
{
"title" : "2013-02-18",
"value" : 0
@tjw
tjw / NSURLEncodingCase.m
Created March 18, 2013 18:23
Radar 13443089
#import <Foundation/Foundation.h>
/*
clang -Wall -O2 -fobjc-arc NSURLEncodingCase.m -framework Foundation -o NSURLEncodingCase
./NSURLEncodingCase 'https://localhost/test%5b' 'https://localhost/test%5B'
2013-03-18 11:04:42.663 NSURLEncodingCase[80520:707] https://localhost/test%5b is NOT equal https://localhost/test%5B
http://tools.ietf.org/html/rfc3986#section-2.1 says
@tjw
tjw / write-file-by-merging.m
Created February 7, 2013 01:11
Test case for Radar 13167947.
#import <Foundation/Foundation.h>
/*
clang -fobjc-arc -O2 -Wall write-file-by-merging.m -o write-file-by-merging -framework Foundation
echo qq > $HOME/Desktop/qq.txt
open -e $HOME/Desktop/qq.txt
then:
@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:] ()
#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);
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
--------------- 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.
static id _commonInit(MyView *self)
{
// common init stuff like so...
self.opaque = YES;
self->_scale = 1.0;
return self;
}
- initWithFrame:(CGRect)frame;
@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
[OUIAnimationSequence runWithDuration:0.3
actions:
^{
// step 1
},
^{
// step 2
},
^{