Skip to content

Instantly share code, notes, and snippets.

View OliverLetterer's full-sized avatar
👨‍💻
Happy coding :)

Oliver Letterer OliverLetterer

👨‍💻
Happy coding :)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am OliverLetterer on github.
  • I am oletterer (https://keybase.io/oletterer) on keybase.
  • I have a public key whose fingerprint is 9910 2A1F 6875 18FD DD01 24B0 A3CC E071 1958 9637

To claim this, I am signing this object:

When dismissing a view controller on top of a view controller with UIModalPresentationPageSheet or UIModalPresentationFormSheet, the presenting view controllers frame and transform can get miscomputed on iOS 7. Here is a fix I used in SPLSpeechBubblePopoverController:

@implementation UIViewController (SPLSpeechBubblePopoverControllerHack)

+ (void)load
{
    class_swizzleSelector(self, @selector(dismissViewControllerAnimated:completion:), @selector(__SPLSpeechBubblePopoverControllerDismissViewControllerAnimated:completion:));
}
// Taken from http://PSPDFKit.com. This snippet is under public domain.
#define UIKitVersionNumber_iOS_7_0 0xB57
BOOL PSPDFIsUIKitFlatMode(void) {
static BOOL isUIKitFlatMode = NO;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
// We get the modern UIKit if system is running >= iOS 7 and we were linked with >= SDK 7.
if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) {
isUIKitFlatMode = (NSVersionOfLinkTimeLibrary("UIKit") >> 16) >= UIKitVersionNumber_iOS_7_0;
}
# Install libxml2 using Homebrew
# If you don't have Homebrew, follow the instructions at:
# https://github.com/mxcl/homebrew/wiki/Installation
# -------------------------------------------------------
brew install libxml2
# Install libxslt from source code
# If you don't have wget, follow the instructions at:
# http://www.mactricksandtips.com/2008/07/installing-wget-on-your-mac-for-terminal.html
# Or use Homebrew:
@OliverLetterer
OliverLetterer / guide.md
Last active July 19, 2018 15:44
epson wireless guide

Reset WLAN interface to default values

  • printer off
  • hold tiny reset button on the back
  • keep holding tiny reset button for around 20 seconds while powering on the printer

print current wireless settings

  • printer on and booted
  • hold tiny reset button for around 5 seconds
@OliverLetterer
OliverLetterer / gist:6049349
Created July 21, 2013 18:06
Log all used CAFilter operations
typedef struct CAColorMatrix {
float m11, m12, m13, m14, m15;
float m21, m22, m23, m24, m25;
float m31, m32, m33, m34, m35;
float m41, m42, m43, m44, m45;
} CAColorMatrix;
@interface CAFilter : NSObject
@property(copy) NSString *name;
// Created by Nick Snyder on 11/13/12.
// NDCollectionViewFlowLayout.h
@interface NDCollectionViewFlowLayout : UICollectionViewFlowLayout
@end
@OliverLetterer
OliverLetterer / cocoapods.zsh
Last active December 16, 2015 20:49
zsh script for automatically sending pull-request to CocoaPods/Specs:master without push access. make sure you have https://github.com/defunkt/hub installed
user="OliverLetterer"
master="CocoaPods"
pod-lint() {
pod spec lint --local --verbose
}
pod-release() {
git add -A && git commit -m "Release "$1"."
git tag $1
#import <UIKit/UIKit.h>
@interface UIView (SMFrameAdditions)
@property (nonatomic, assign) CGPoint $origin;
@property (nonatomic, assign) CGSize $size;
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect
@end
@OliverLetterer
OliverLetterer / Find files to refactor
Created March 11, 2013 21:05
Find files which are worth to refactor
sloccount --details . | sort -n -k1,1