Skip to content

Instantly share code, notes, and snippets.

View loehnertz's full-sized avatar

Jakob Löhnertz loehnertz

View GitHub Profile
@loehnertz
loehnertz / Extensions.kt
Created December 6, 2021 20:55
Handy Kotlin Extension Functions
/**
* Swaps the order of the elements of the given [Pair] in a type-safe manner.
*
* Example:
* ```
* Pair("David", 32).swap() // Pair(32, "David")
* ```
*/
fun <A, B> Pair<A, B>.swap(): Pair<B, A> = this.second to this.first
@loehnertz
loehnertz / exam.hs
Last active October 24, 2018 07:15
SSVT Exam 2017
module Exam2018 where
import Data.List
import Test.QuickCheck
-- Exercise 5
jos :: Int -> Int -> Int -> Int
jos n k 0 = rem (k-1) n
@loehnertz
loehnertz / exam.hs
Last active March 5, 2019 09:54
SSVT Exam 2018
module Exam2018 where
import Data.Char
import Data.List
import Test.QuickCheck
-- Hoare Triples --
-- Use this to validate a Hoare triple respectively to find a counter-example (Domain: Integers)
@loehnertz
loehnertz / augs.ino
Created January 18, 2018 12:37
AUGS – Hardware
// IMPORTS ANFANG
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
// IMPORTS ENDE
// PIN KONFIGURATION ANFANG
#define COLOR_S0 D0
#define COLOR_S1 D1
#define COLOR_S2 D2
#define COLOR_S3 D3
@loehnertz
loehnertz / cVim
Last active January 24, 2017 10:53
cVimrc
set noautofocus
set scalehints
set autoupdategist
let barposition = "bottom"
map a :open google<Space>
map A :tabnew google<Space>