Skip to content

Instantly share code, notes, and snippets.

View wookiee's full-sized avatar
🤗
Biting shoulders

Mikey Ward wookiee

🤗
Biting shoulders
View GitHub Profile
@wookiee
wookiee / ImageStore.swift
Created September 30, 2016 15:25
ImageStore.swift to use with the Advanced iOS pre-course workbook
//
// Copyright © 2015 Big Nerd Ranch
//
import UIKit
class ImageStore {
let cache = NSCache<NSString, UIImage>()
This file has been truncated, but you can view the full file.
Last login: Wed Jun 19 10:26:56 on console
Welcome to fish, the friendly interactive shell
Type help for instructions on how to use fish
mikey@Helia ~> grep "objc_msgSend" /usr/include
grep: /usr/include: No such file or directory
mikey@Helia ~>
cd /Users/mikey/Library/Developer/Xcode/DerivedData/Messagr-eojnakkqlnqiwpgmrkytadqxcneo/Build/Products/Debug
mikey@Helia ~/L/D/X/D/M/B/P/Debug> ls
Messagr
mikey@Helia ~/L/D/X/D/M/B/P/Debug>
@wookiee
wookiee / gist:5330917
Created April 7, 2013 15:26
Kernel panic in Xcode 4.6.1. Been getting this about once daily.
Interval Since Last Panic Report: 3427 sec
Panics Since Last Report: 1
Anonymous UUID: 45E12F51-7AB2-A8DF-DBA4-652AFCA3CB9B
Sun Apr 7 11:09:58 2013
panic(cpu 0 caller 0xffffff8003cb7e95): Kernel trap at 0xffffff8003c4138e, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0x0000000000000000, CR3: 0x000000015f6d0040, CR4: 0x00000000001606e0
RAX: 0x000000000000fffe, RBX: 0x0000000000000002, RCX: 0x0000000002000000, RDX: 0x0000000000000002
RSP: 0xffffff81d4eb3e40, RBP: 0xffffff81d4eb3e80, RSI: 0x0000000000000000, RDI: 0x0000000000000000
R8: 0x000000000000000a, R9: 0x0000000000000000, R10: 0x00007fff8c8c98b6, R11: 0x0000000000000246
@wookiee
wookiee / gist:4430204
Created January 1, 2013 21:35
singleton shared instance creation with dispatch_once()
+ (id)sharedInstance
{
static dispatch_once_t onceQueue;
static <#Type#> *instance = nil;
dispatch_once(&onceQueue, ^{ instance = [[self alloc] init]; });
return instance;
}
@wookiee
wookiee / gist:1946387
Created March 1, 2012 01:08
viewDidAppear in BNRDocumentPageViewController for better page curling (not perfect)
- (void)viewDidAppear:(BOOL)animated
{
UIView *targetView = self.view.superview.superview; // UINavigationTransitionView
targetView.clipsToBounds = NO;
[targetView.superview bringSubviewToFront:targetView];
targetView = targetView.superview; // UILayoutContainerView
targetView.clipsToBounds = NO;
[targetView.superview bringSubviewToFront:targetView];
@wookiee
wookiee / gist:1684645
Created January 26, 2012 19:44
Backtrace when breakpointing a setter under LLDB
(lldb) thread backtrace
* thread #1: tid = 0x1f03, 0x00001a50 Bugspray`start, stop reason = breakpoint 1.1
frame #0: 0x00001a50 Bugspray`start
frame #1: 0x06835d90
frame #2: 0x00002881 Bugspray`-[BNRViewController calcOperate:] + 113 at BNRViewController.m:78
frame #3: 0x013bcec9 CoreFoundation`-[NSObject performSelector:withObject:withObject:] + 73
frame #4: 0x000155c2 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 96
frame #5: 0x0001555a UIKit`-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
frame #6: 0x000bab76 UIKit`-[UIControl sendAction:to:forEvent:] + 66
frame #7: 0x000bb03f UIKit`-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 503