Skip to content

Instantly share code, notes, and snippets.

@n-b
n-b / NBResponderChainUtilities.h
Last active August 3, 2021 10:08
Chain Responder Debugging Methods
//
// NBResponderChainUtilities.h
//
// Created by Nicolas @ bou.io on 19/04/13.
//
#import <UIKit/UIKit.h>
@interface UIView (NBResponderChainUtilities)
- (UIView*) nb_firstResponder; // Recurse into subviews to find one that responds YES to -isFirstResponder
@n-b
n-b / fp-obj-c.m
Created February 9, 2015 09:28
fp-obj-c
//#!/usr/bin/env objc-run
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <objc/message.h>
///
/// Typedefs
typedef id (^TargetMethod)(id arg);
@n-b
n-b / selfcompile.m
Last active April 29, 2019 03:43
A simple self-compiling objective-c file
/*/../bin/ls > /dev/null
COMPILED=${0%.*}
clang $0 -o $COMPILED -framework Foundation;
$COMPILED; rm $COMPILED; exit;
*/
#import <Foundation/Foundation.h>
int main(int argc, char *argv[])
@n-b
n-b / gist:405e12d431f5e62bb4ff
Created December 22, 2014 14:09
NSData hexadecimalRepresentation
(lldb) po [@"Hello World" dataUsingEncoding:4]
<48656c6c 6f20576f 726c64>
(lldb) po [[@"Hello World" dataUsingEncoding:4] lowercaseHexStringWithoutSpaces]
48656c6c6f20576f726c64
(lldb) po [[@"Hello World" dataUsingEncoding:4] uppercaseHexStringWithoutSpaces]
48656C6C6F20576F726C64
(lldb) po [[@"Hello World" dataUsingEncoding:4] CKHexString]

Keybase proof

I hereby claim:

  • I am n-b on github.
  • I am nb_ (https://keybase.io/nb_) on keybase.
  • I have a public key whose fingerprint is 7986 EEEE 8135 07D0 F9AB C21E 87FD 5957 5246 035A

To claim this, I am signing this object:

@n-b
n-b / Alimentation et agronomie.m3u
Last active March 1, 2017 13:30
C’est pas sorcier - Youtube
#EXTM3U
#EXTINF:-1,C'est pas sorcier - Sel de la mer à la terre
https://www.youtube.com/watch?v=ChUai6Wbm78
#EXTINF:-1,C'est pas sorcier -PESTICIDES
https://www.youtube.com/watch?v=Cqm6Ztr-ndg
#EXTINF:-1,C'est pas sorcier -CUISINE DE CHEF : la science des saveurs
https://www.youtube.com/watch?v=Kc2fjylFIa4
#EXTINF:-1,C'est pas sorcier - BANANES : sorciers à plein régime
https://www.youtube.com/watch?v=xguEgpLQV3k
#EXTINF:-1,C'est pas sorcier -CHAMPAGNE : LES SORCIERS SE FONT MOUSSER
in UITableViewCell:
_tableView (<UITable_UITableViewCellDelegate>*): nil
_layoutManager (id): <UITableViewCellLayoutManager: 0x6080000150a0>
_target (id): nil
_editAction (SEL): (null)
_accessoryAction (SEL): (null)
_oldEditingData (_UITableViewCellOldEditingData*): nil
_editingData (id): nil
_rightMargin (double): 0
_indentationLevel (long): 0
@n-b
n-b / PropertyMacros.h
Created April 15, 2012 18:45
KVC compile-time checking macros
//
// PropertyMacros.h
//
//
// Created by Nicolas Bouilleaud on 12/04/12,
// using ideas by Uli Kusterer (http://orangejuiceliberationfront.com/safe-key-value-coding/)
// Laurent Deniau (https://groups.google.com/forum/?fromgroups#!topic/comp.std.c/d-6Mj5Lko_s)
// and Nick Forge (http://forgecode.net/2011/11/compile-time-checking-of-kvc-keys/)
//
//
@n-b
n-b / Blocks.m
Last active August 24, 2016 11:37
#!/usr/bin/env objc-run
@import Foundation;
@interface NSBlock // bite me
@end
@implementation NSBlock (invoke)
- (void) invoke
{
@n-b
n-b / TestAttributedStrings.m
Created January 13, 2014 10:05
Demo for a NSAttributedString / HTML parsing issue on iOS 7
@import UIKit;
#pragma mark - Main View Controller
@interface ViewController : UITableViewController
@end