Skip to content

Instantly share code, notes, and snippets.

View Daniel1of1's full-sized avatar
👋

Daniel Haight Daniel1of1

👋
  • Confidence Designed London
View GitHub Profile
(lldb) br s -n objc_msgSend -c 0
(lldb) c
**Do something eg. tap screen**(and wait)
(lldb) breakpoint list
//output (see 'hit count' :) )
Current breakpoints:
1: name = 'objc_msgSend', locations = 1, resolved = 1
Condition: 0
@Daniel1of1
Daniel1of1 / gist:8932331
Created February 11, 2014 10:16
ABPropertyPhoneNumberCell view heirarchy
<ABPropertyPhoneNumberCell: 0x111305ba0; baseClass = UITableViewCell; frame = (0 96; 320 58.5); autoresize = W; layer = <CALayer: 0x111301940>>
| <UITableViewCellScrollView: 0x111309690; frame = (0 0; 320 58.5); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x1113099b0>; layer = <CALayer: 0x111300f40>; contentOffset: {0, 0}>
| | <UITableViewCellContentView: 0x111301ea0; frame = (0 0; 320 58.5); gestureRecognizers = <NSArray: 0x11130ead0>; layer = <CALayer: 0x1113077b0>>
| | | <UIView: 0x111305f80; frame = (0 3; 320 55); autoresize = W+H; layer = <CALayer: 0x111302390>>
| | | | <UILabel: 0x11130f170; frame = (35 9; 37 17); text = 'home'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <CALayer: 0x1113023b0>>
| | | | <UILabel: 0x11130edc0; frame = (35 28; 193 21); text = '0782355'; clipsToBounds = YES; userInteractionEnabled = NO; layer = <CALayer: 0x11130ef00>>
| | | | <ABTransportButton: 0x111302a40; baseClass = UIButton;
@Daniel1of1
Daniel1of1 / gist:8937116
Last active August 29, 2015 13:56
Add an accessory to cells in ABPeoplePickerNavigationController
Class ABMemberDataSourceClass = NSClassFromString(@"ABMembersDataSource");
SEL originalTableViewMethodSelector = @selector(tableView:cellForRowAtIndexPath:);
Method originalTableViewMethod = class_getInstanceMethod(ABMemberDataSourceClass, originalTableViewMethodSelector);
SEL newTableViewMethodSelector = @selector(dhc_tableView:cellForRowAtIndexPath:);
IMP newTableViewMethodImp = imp_implementationWithBlock(^UITableViewCell * (id __unused _self, UITableView *tableView, NSIndexPath *indexPath){
#import "NSURLSession+Swizzle.h"
#import <objc/runtime.h>
@implementation NSURLSession (Swizzle)
+ (void)load{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
Class class = self.class;
@Daniel1of1
Daniel1of1 / NSURLSession+DHCDirtyCoinsFix.m
Created March 14, 2014 22:12
A quick and dirty fix / fun with hopper for coins app
@interface NSURLSession (DHCDirtyCoinsFix)
//lazy way to keep compiler happy
+(void)setLoading:(BOOL)isLoading;
-(UIButton *)updateButton;
- (void)_updateTimerPaused:(BOOL)on;
@end
@implementation NSURLSession (DHCDirtyCoinsFix)
@Daniel1of1
Daniel1of1 / gist:9640174
Created March 19, 2014 11:55
On privacy
"In the absence of the right to privacy, there can be no true freedom of expression and opinion, and therefore no effective democracy..." - Brazilian president Dilma Rousseff
http://www.theguardian.com/world/2013/sep/24/brazil-president-un-speech-nsa-surveillance
[{
"ok": true,
"count": 1,
"data": [{
"type": "event",
"id": "alt",
"label": "XXX - can't remember if we're using this?",
"title": "AltConf",
"date": [ "2014-06-02", "2014-06-06" ],
"locations": [{
@Daniel1of1
Daniel1of1 / session.json
Last active August 29, 2015 14:01
session-talk
{
"id": "alt-session-5", // of form alt-session-x where x is unique should match id as listed in speaker sessions
"title": "Are we using our time how we should",
"abstract": "what really matters?.Uncomfortable questions to get you thinking. 'Am I doing what matters? 'What matters for me?' 'Am I making a dent in the universe?' 'Do I care?'",
"description": "",
"url": "http://altconf.com/speakers", // always the same
"begin": "2014-06-02T14:00:00-08:00", // iso8601
"end": "2014-06-02T14:30:00-08:00",
"duration": 30,
"day": {
[
{
"id": "lifestyle",
"label_en": "Lifestyle",
"color": [244.0, 79.0, 244.0, 1.0],
},
{
"id": "development",
"label_en": "Development",
"color": [246.0, 105.0, 106.0, 1.0],
[
{
"id": "creativity-museum",
"label_en": "Children's Creativity Museum",
"is_stage": true,
"floor": 0,
"order_index": 0,
},
{
"id": "jillians",