Skip to content

Instantly share code, notes, and snippets.

View jonasreinsch's full-sized avatar
🎯
Focusing

Jonas Reinsch jonasreinsch

🎯
Focusing
View GitHub Profile
@jonasreinsch
jonasreinsch / til.md
Last active February 25, 2016 15:35
TIL (Today I learned)

2016-02-25

Python has type annotations since 3.5:

def greater_than_10(a:int) -> bool:
    return a > 10

class Tank:
    def __init__(self):
        self.fill = 0
;; Paar binden mit let in Emacs Lisp
;; binde das Paar (1 . 2) an den Namen my-pair
;; (wie eine lexikalische Variable,
;; dh Name ist nur innerhalb des let-Blockes gültig)
;; Dadurch könntest Du dann auf die Elemente des
;; Paares einzeln zugreifen, ohne die Fkt erneut
;; auszuwerten
(let (
(my-pair '(1 . 2))
@jonasreinsch
jonasreinsch / rounded_polygon_path
Created December 2, 2014 11:39
function to create a UIBezierPath for a (rounded corner) polygon in Swift
// this is a port from the following Objective C code
// http://stackoverflow.com/a/24770675/1269132
func roundedPolygonPath(
#square:CGRect,
#lineWidth:Double,
#sides:NSInteger,
#cornerRadius:Double) -> UIBezierPath {
let path = UIBezierPath()