Skip to content

Instantly share code, notes, and snippets.

-(void)awakeFromNib __attribute__((objc_requires_super));
-(void)prepareForReuse __attribute__((objc_requires_super));
@mattyohe
mattyohe / gist:8744063
Created January 31, 2014 21:53
dump those dwarfs!
dwarfdump --uuid myapp.app/myapp
dwarfdump --uuid myapp.app.dSYM
@mattyohe
mattyohe / gist:8787771
Created February 3, 2014 17:00
Bash substitution rename pngs to @2x
for i in *.png; do mv "$i" "${i%.png}@2x.png"; done
@mattyohe
mattyohe / gist:eb80b77ea668ebeeef45
Last active August 29, 2015 14:01
HTML TextView sizing information
NSLayoutManager *layoutManager = [[self textView] layoutManager];
NSTextContainer *container = [[self textView] textContainer];
[layoutManager ensureLayoutForTextContainer:container];
CGRect rect = [layoutManager usedRectForTextContainer:container];
CGFloat height = CGRectGetHeight(rect);
UIEdgeInsets insets = [[self textView] textContainerInset];
height += insets.top;
height += insets.bottom;
height = ceilf(height);
return CGSizeMake(320, height + 16); // 16 comes from the current top and bottom cell padding.
@mattyohe
mattyohe / Swift.swift
Last active August 29, 2015 14:02
Swift STDLIB - Beta 3
operator infix .. {
}
operator infix * {
}
operator infix & {
}
operator infix + {
🔜 Thermometer
🔜 Black Droplet
🔜 White Sun
🔜 White Sun With Small Cloud
🔜 White Sun Behind Cloud
🔜 White Sun Behind Cloud With Rain
🔜 Cloud With Rain
🔜 Cloud With Snow
🔜 Cloud With Lightning
🔜 Cloud With Tornado
@mattyohe
mattyohe / gist:7df92ec63d19a876794d
Created October 29, 2014 04:07
True/False not exhaustive.
var yesNo: Bool = true
switch (yesNo) {
case true:
println("True")
case false:
println("False")
}
private var _finished: Bool = false;
override var finished: Bool {
get {
return _finished
}
set {
if _finished != newValue {
willChangeValueForKey("isFinished")
_finished = newValue
didChangeValueForKey("isFinished")
@mattyohe
mattyohe / gist:765e9e9db14b3b4a00c7
Created December 8, 2014 19:10
Check entitlements on a binary
codesign -d --entitlements - AppBinary
@mattyohe
mattyohe / gist:1755ae10470ee215bb30
Created December 8, 2014 20:02
UIScrollView UIButton allow scrolling
- (BOOL)touchesShouldCancelInContentView:(UIView *)view
{
if ( [view isKindOfClass:[UIButton class]] ) {
return YES;
}
return [super touchesShouldCancelInContentView:view];
}