Skip to content

Instantly share code, notes, and snippets.

👨‍💻
Happy coding :)

Oliver Letterer OliverLetterer

👨‍💻
Happy coding :)
  • Germany
Block or report user

Report or block OliverLetterer

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@OliverLetterer
OliverLetterer / encrypted-git-repo.md
Created Jan 22, 2017
Transparent Git Encryption
View encrypted-git-repo.md

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

View gist:7febd3f8984e0f3247ca7c4b07a6dd1b
// The trick is to copy the DeviceSupport folder from the beta to the stable version.
cp -r /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5261u\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
// Then restart Xcode. You might need to do that for every beta of iOS 10/Xcode 8.
@OliverLetterer
OliverLetterer / sethack.m
Created Mar 11, 2016 — forked from Catfish-Man/sethack.m
Demonstrating the trick of using stack-allocated mimics and sets for lookup tables instead of heap allocated keys and dictionaries
View sethack.m
// Compile with clang -framework Foundation sethack.m
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
/*
CFHashBytes from http://www.opensource.apple.com/source/CF/CF-1153.18/CFUtilities.c
*/
#define ELF_STEP(B) T1 = (H << 4) + B; T2 = T1 & 0xF0000000; if (T2) T1 ^= (T2 >> 24); T1 &= (~T2); H = T1;
View tollfree.m
//Given this:
NSArray *objects = @[@1, @2, @3]
//These are equivalent in behavior
NSNumber *first = [objects objectAtIndex:0]
NSNumber *second = (NSNumber *)CFArrayGetValueAtIndex(0)
//But is the code that runs the same? Not so much… in the first one we do…
objc_msgSend(objects, <selector reference>, 0)
-> http://sealiesoftware.com/msg/x86-mavericks.html
@OliverLetterer
OliverLetterer / xctest_finder.py
Created Dec 30, 2015 — forked from briancroom/xctest_finder.py
Script to assist with conforming to XCTestCaseProvider
View xctest_finder.py
#!/usr/bin/python
# Invoke this script with a Swift file containing an XCTestCase and it will
# generate an implementation for the `allTests` variable required for
# XCTestCaseProvider conformance on Linux
import sys
import re
inFile = open(sys.argv[1]) if len(sys.argv) > 1 else sys.stdin
@OliverLetterer
OliverLetterer / terminal
Created Apr 3, 2015
Count insertions / deletions in git repo
View terminal
git log HEAD...3649b6a056d72524205b57791e7c78f3ac209f7e --numstat | grep ViewController.m | awk '{ INS += $1; DEL += $2 } END { print "+" INS " -" DEL }'
View ios_github_gif.md

Record a screencast with QuickTime Player

  1. Connect an iOS defice with a cable
  2. In QuickTime Player: Option-Cmd-N (New Movie Recording) -> Select your device from the recording menu:

http://cl.ly/image/1w0y3Y0H2g2X/record.png

Install gifify

View NSArray+BadThirdPartyImplementation.m
@implementation NSArray (BadThirdPartyImplementation)
- (id)firstObject
{
return self[0];
}
@end
View introrx.md

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

View keybase.md

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:

You can’t perform that action at this time.