Skip to content

Instantly share code, notes, and snippets.

Working from home

Klaas Pieter Annema klaaspieter

Working from home
Block or report user

Report or block klaaspieter

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
klaaspieter / find-pr-reference.js
Created Jul 23, 2019
It makes me sad that this is the best way to find the associated pull request of a GitHub issue
View find-pr-reference.js
View Set.playground
precedencegroup ForwardApplication {
associativity: left
infix operator |>: ForwardApplication
public func |> <A, B>(x: A, f: (A) -> B) -> B {
return f(x)
precedencegroup SingleTypeComposition {
associativity: right
klaaspieter / UILayoutPriority.swift
Created Mar 7, 2018
Convenience UILayoutPriority extension for more declarative content hugging (and compression resistance) definition
View UILayoutPriority.swift
import UIKit
import PlaygroundSupport
let view = UIView(frame: CGRect(x: 0, y: 0, width: 414, height: 100))
view.backgroundColor = .white
let titleLabel = UILabel()
titleLabel.text = "Hello"
titleLabel.backgroundColor = .purple

Keybase proof

I hereby claim:

  • I am klaaspieter on github.
  • I am klaaspieter ( on keybase.
  • I have a public key ASCTKhdPDvJLhI4JoXgJEUEgM6PhrUepfEt-bWxhEBEvzgo

To claim this, I am signing this object:

klaaspieter / Calendar.swift
Last active Jul 10, 2017
Calendar extension to determine wether a date is after today
View Calendar.swift
import Foundation
extension Calendar {
/// Returns `true` if the given date is after today, as defined by the calendar and calendar's locale.
/// Because it's impossible to define the end of a day (there are an infinite number of
/// milliseconds between 23:59:59 and 00:00:00), this method instead ensures that
/// `date` >= `startOfTomorrow`.
/// - parameter date: The specified date.
klaaspieter /
Created Jun 22, 2017 — forked from anonymous/
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

klaaspieter / Instabug.json
Created Mar 17, 2017
Instabug Carthage Binary Project Specification
View Instabug.json
"7.1": ""
klaaspieter / xcrecord
Last active Dec 13, 2016
Record video from the running (> Xcode 8.2) simulator and convert it to gif
View xcrecord
xcrun simctl io booted recordVideo "$tmp_file"
ffmpeg -i "$tmp_file" -pix_fmt rgb24 -r 10 -f gif - \
| gifsicle --optimize=3 > "$output"
rm -r "$tmp_file"
klaaspieter / p12 -> pem
Last active May 20, 2016
Convert from p12 to pem and copy contents
View p12 -> pem
openssl pkcs12 -in Certificates.p12 -nodes -clcerts | pbcopy
klaaspieter / tap.playground
Last active Mar 28, 2017
Ruby's tap method in a Swift playground (original blog post:
View tap.playground
import Foundation
Ruby has a nice method called `tap`, which I wanted to try and port to Swift. To learn what it does, let’s take a look at [Ruby’s documentation](
> Yields self to the block, and then returns self. The primary purpose of this method is to “tap into” a method chain, in order to perform operations on intermediate results within the chain.
Yeah, right. I don’t really know what that means. Googling yields (no pun intended) many contrived examples like these:
[1, 2, 3, 4].tap &:reverse! # [4, 3, 2, 1]
You can’t perform that action at this time.