Skip to content

Instantly share code, notes, and snippets.

View ldrr's full-sized avatar

Christoph Lederer ldrr

  • Christoph Lederer
  • Wiener Neustadt / Austria
View GitHub Profile

Keybase proof

I hereby claim:

  • I am ldrr on github.
  • I am ldrr (https://keybase.io/ldrr) on keybase.
  • I have a public key whose fingerprint is 8BD2 3B46 E355 1E0B 403B DC6F 8EF3 6435 2C3A 1913

To claim this, I am signing this object:

@ldrr
ldrr / Array+ReduceDelta.swift
Created February 28, 2018 08:25
Neat extension for array delta
extension Array {
public func reduceDelta<Result>(_ initialResult: Result, _ nextPartialResult: (Result, Element, Element) throws -> Result) rethrows -> Result {
guard var previous = first else {
return initialResult
}
return try dropFirst().reduce(initialResult, { result, element in
let nextResult = try nextPartialResult(result, previous, element)
previous = element
return nextResult
@ldrr
ldrr / openx.sh
Last active March 28, 2019 09:29
openx by @orta
# Xcode via @orta
openx(){
if test -n "$(find . -maxdepth 1 -name '*.xcworkspace' -print -quit)"
then
echo "Opening workspace"
open *.xcworkspace
return
else
if test -n "$(find . -maxdepth 1 -name '*.xcodeproj' -print -quit)"
then