Skip to content

Instantly share code, notes, and snippets.

View wbyoung's full-sized avatar

Whitney Young wbyoung

  • FadingRed
  • Portland, OR
View GitHub Profile
@wbyoung
wbyoung / game-no-a.json
Created April 4, 2014 20:51
JSI game description without an "A" room
{
"rooms": [
{
"name": "Z",
"north": "D",
"east": "B",
"south": null,
"west": null
},
{
@wbyoung
wbyoung / safari-7-ajax-failure
Created November 28, 2013 19:52
Safari 7.0 Intermittent Failure Ajax Settings
{
"url":"/some/url/",
"type":"POST",
"isLocal":false,
"global":true,
"processData":true,
"async":true,
"contentType":"application/x-www-form-urlencoded; charset=UTF-8",
"accepts":{
"*":"*/*",
#define FRLog(format,...) \
NSLog(@"%@:%i:%s" format, \
[[NSString stringWithUTF8String:__FILE__] lastPathComponent], \
__LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__)
@wbyoung
wbyoung / gist:1941795
Created February 29, 2012 15:40
NSInvocation va_arg crash explanation
// clang -o test test.m -framework Foundation
#import <Foundation/Foundation.h>
@interface Forwarder : NSObject {
@package;
id destination;
}
@end
@wbyoung
wbyoung / test.m
Created November 29, 2011 17:49
Macro for safely call nil block
// gcc test.m -o test -framework Foundation
#import <Foundation/Foundation.h>
#define safeblock(block) ((typeof(block))(block ? ((id)block) : ((id)^{})))
int main() {
void (^block)(NSString *) = ^(NSString *anArgument){
NSLog(@"Hello %@", anArgument);
};
safeblock(block)(@"world");