Skip to content

Instantly share code, notes, and snippets.

View chrisport's full-sized avatar

Christoph Portmann chrisport

  • Berlin
View GitHub Profile
interface Subject
interface Verb
infix fun Subject.can(what: Verb): Verb = what
infix fun <T> Subject.seems(what: T) = what
infix fun <T> Any.with(withWhat: T) = withWhat
infix fun <T> Any.odd(oddWhat: T) = oddWhat
infix fun <T> Any.of(ofWhat: T) = ofWhat
infix fun <T> Any.any(what: T) = what
@chrisport
chrisport / clean_code.md
Created October 23, 2018 22:32 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@chrisport
chrisport / ansible-summary.md
Created July 16, 2018 09:19 — forked from andreicristianpetcu/ansible-summary.md
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@chrisport
chrisport / permutations.go
Last active August 29, 2015 14:07
Generate Permutations of String in Golang
package permutations
func merge(ins []rune, c rune) (result []string) {
for i := 0; i <= len(ins); i++ {
result = append(result, string(ins[:i])+string(c)+string(ins[i:]))
}
return
}
func permutations(input string) []string {