Skip to content

Instantly share code, notes, and snippets.

- (GMGridViewCell *)GMGridView:(GMGridView *)gridView cellForItemAtIndex:(NSInteger)index {
CGSize size = [self sizeForItemsInGMGridView:gridView];
GMGridViewCell *cell = [gridView dequeueReusableCell];
if (!cell) {
cell = [[GMGridViewCell alloc] initWithFrame:CGRectMake(0, 0, size.width, size.height)];
}
Piece *piece = [self.project.pieces objectAtIndex:index];
sudo /usr/bin/xcode-select -switch /Applications/Xcode.app
@colinhumber
colinhumber / gist:3062522
Created July 6, 2012 20:10
WebKit error when filling in for on iOS
// thrown on every key press
2012-07-06 14:09:54.264 xxx[15272:1cd03] *** WebKit discarded an uncaught exception in the textDidChangeInTextField:inFrame: delegate: <NSInvalidArgumentException> *** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]
// app crashes when submitting form
2012-07-06 14:09:59.343 xxx[15272:1cd03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(0x1610d72 0x1221e51 0x15c60a4 0x15d83b2 0x15d7f5c 0x480389 0x4809c6 0x480354 0x575cee 0x379945 0x1604f5d 0x1604e81 0x1604fea 0x33db6d1 0x1600b12 0x160076e 0x1604f5d 0x1604e81 0x422e4f3 0x422e068 0x15950ef 0x1594b1f 0x15b76c4 0x15b6ed4 0x15b6dab 0x220d923 0x220d7a8 0x1cde71 0x291d 0x2845)
libc++abi.dylib: terminate called throwing an exception
@colinhumber
colinhumber / gist:4674925
Created January 30, 2013 17:30
Add Git branch to your path in Terminal
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\[\033[m\]\w\[\033[0;36m\]$(parse_git_branch)\[\e[0m\]: '
@colinhumber
colinhumber / Image2Map.py
Last active December 20, 2015 22:18 — forked from bjorn/Image2Map.py
Python scripts for generating a tile set and tile map from an image. Modified to allow for transparency.
# Filename : Image2Map.py
# Authors : Georg Muntingh and Bjorn Lindeijer
# Version : 1.2
# Date : June 16, 2010
# Copyright : Public Domain
import os, sys, Image, networkx
class TileMap:
""" This class represents a map of tiles.
@colinhumber
colinhumber / gist:7205441
Created October 28, 2013 21:50
iOS tutorials for beginners
http://designthencode.com/scratch/
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Introduction/Introduction.html
http://www.raywenderlich.com/
https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/index.html
http://www.stanford.edu/class/cs193p/cgi-bin/drupal/
Not doing anything. The app just crashes every time it automatically or manually update the snippets.
Process: Xcode [29287]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.0.2 (3335.32)
Build Info: IDEApplication-3335032000000000~4
App Item ID: 497799835
App External ID: 106632651
Code Type: X86-64 (Native)
### Keybase proof
I hereby claim:
* I am colinhumber on github.
* I am colinhumber (https://keybase.io/colinhumber) on keybase.
* I have a public key whose fingerprint is 0F25 9272 C700 B0BF BD75 E02A CB11 6A19 6150 22B2
To claim this, I am signing this object:
@colinhumber
colinhumber / gist:5a11de79075b1585d9bf
Created March 11, 2015 02:37
LLDB error using Swift Xcode 6.2
error: <EXPR>:1:11: error: use of undeclared type '$__lldb_context'
extension $__lldb_context {
^~~~~~~~~~~~~~~
<EXPR>:11:5: error: use of unresolved identifier '$__lldb_injected_self'
$__lldb_injected_self.$__lldb_wrapped_expr_3(
^
@colinhumber
colinhumber / HackyNavBar
Created September 20, 2017 14:16
Hacky way to get a custom nav bar height
#import "SBBaseNavigationBar.h"
@interface SBBaseNavigationBar (iOS11HacksPrivate)
@property (nullable, nonatomic, readonly) UIView *navigationBarContentView;
@end