Skip to content

Instantly share code, notes, and snippets.

Incident Identifier: EFCFB775-461F-433B-A5E5-1CF997225AE1
CrashReporter Key: fbc7a0ea8298bef42a8c9365f3f20cfcecb6da61
Hardware Model: iPhone8,2
Process: domino-free [724]
Path: /private/var/containers/Bundle/Application/EAAF07E2-B41C-4DCE-B3CC-86713EF0A675/domino-free.app/domino-free
Identifier: com.flyclops.domino-free
Version: 331 (2.7.6)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
@jakeobrien
jakeobrien / gist:5503948
Created May 2, 2013 17:43
Shuffle logic for Domino! bones
// for native iOS (Objective-C)
srand((unsigned)time(NULL));
NSUInteger count = [bones count];
for (NSUInteger i = 0; i < count; ++i) {
int nElements = count - i;
int n = (rand() % nElements) + i;
[bones exchangeObjectAtIndex:i withObjectAtIndex:n];
}
@jakeobrien
jakeobrien / gist:4990454
Last active December 13, 2015 23:19
Unity .gitignore
obj
Temp
*.tmproj
*.csproj
*.unityproj
*.sln
*.suo
*.user
*.pidb
*.userprefs
---- APP VERSION -----
----- 1.2 (76) -----
CONFIG FORMAT
{
// how many seconds between polling for opponent move, default 3.5
@jakeobrien
jakeobrien / .gitignore
Created February 8, 2011 06:54
.gitignore for xcode 4
# osx noise
.DS_Store
profile
*.moved-aside*
# xcode noise
[bB]uild/*
*.pbxuser
*.mode*
@jakeobrien
jakeobrien / GridLayout.m
Created November 4, 2010 21:34
Lays out a number of rects of given aspect ratio in a given frame.
- (void)drawGridWithFrame:(CGRect)rect containing:(int)numSquares squaresOfAspectRatio:(float)aspectRatio margin:(float)margin addToArray:(NSMutableArray *)array {
float totalArea = rect.size.width * rect.size.height;
float areaPerSquare = floorf(totalArea / numSquares);
float height = sqrtf(areaPerSquare/aspectRatio);
CGSize squareSize = CGSizeMake(aspectRatio * height, height);
int numPerRow = (int)floorf(rect.size.width / squareSize.width);
int numPerCol = (int)floorf(rect.size.height / squareSize.height);
if (numPerCol * numPerRow < numSquares) {