This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// AppDelegate.m | |
// MouseTest | |
// | |
// Created by Seth Willits on 1/30/14. | |
// Copyright (c) 2014 Araelium Group. All rights reserved. | |
// | |
#import "AppDelegate.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void *Sys_LoadDll( const char *name, char *fqpath, | |
int( **entryPoint ) ( int, ... ), | |
int ( *systemcalls )( int, ... ) ) { | |
void *libHandle; | |
void ( *dllEntry )( int ( *syscallptr )( int, ... ) ); | |
char fname[MAX_OSPATH]; | |
char *pwdpath; | |
char *homepath; | |
char *basepath; | |
char *gamedir; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
graph "Seth's Graph" { | |
graph [dpi=72, | |
overlap=orthoxy, | |
sep=0.27777, | |
splines=false | |
]; | |
node [fixedsize=1, | |
height=0.5, | |
label="\N", | |
shape=box, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// APTokenSearchField.h | |
// TokenFieldTest | |
// | |
// Created by Seth Willits on 12/4/13. | |
// Copyright (c) 2013 Araelium Group. All rights reserved. | |
// | |
#import <Cocoa/Cocoa.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation AppDelegate | |
{ | |
AGApplicationMoved * _moved; | |
} | |
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
_moved = [[AGApplicationMoved watchForApplicationMoving:^{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
void eachrow(size_t total, size_t nrows, size_t ncols, char const*** rows, BOOL(^cb)(size_t i, size_t ncols, char const **row, size_t *lengths)) | |
{ | |
size_t lengths[ncols]; | |
for (size_t k = 0; k < total; ++k) | |
{ | |
size_t i = k % nrows; | |
for (size_t j = 0; j < ncols; ++j) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface NSMenu (SeparatorAdditions) | |
- (void)removeExtraSeparatorItems; | |
@end | |
@implementation NSMenu (SeparatorAdditions) | |
- (void)removeExtraSeparatorItems; | |
{ | |
// Remove separator at index 0 | |
while (self.itemArray.count > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// | |
#include <stdio.h> | |
#include "Game.h" | |
int main(int argc, const char * argv[]) | |
{ | |
Game * game = NewGame(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MethodSwizzle(Class c, SEL orig, SEL new) | |
{ | |
Method origMethod = class_getInstanceMethod(c, orig); | |
Method newMethod = class_getInstanceMethod(c, new); | |
if (class_addMethod(c, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) { | |
class_replaceMethod(c, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod)); | |
} else { | |
method_exchangeImplementations(origMethod, newMethod); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dispatch_source_t dispatch_coalesce_source_create(dispatch_queue_t queue) | |
{ | |
dispatch_source_t src = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, queue); | |
dispatch_resume(src); | |
return src; | |
} | |
void dispatch_coalesce(dispatch_source_t src, double time, void (^block)(void)) | |
{ |