This is a short example of how to write handlers in Go and use the MongoDB mgo driver. Assume you want to write handlers that are in a package and mount this handler under a certain prefix, for instance a HelloHandler mounted on /hello/. So you have a main package and a handler package, called…
Read ArticleMonth: July 2015
Neuer Blog
Habe eine neue Blogsoftware geschrieben, also proof of concept. Mein Privater Blog lebt wieder, allerdings leicht versteckt. Wer ihn findet bekommt … nix. Das ist der erste Schritt zur kompletten persönlichen Seite. Dateien, Bilder, Blog, Wiki und was mir noch so einfällt.
Read ArticleBest Desktop Wallpaper for Work
Best desktop wallpaper for a workstation, imo. Leaves room for imagination, no distraction, nothing too near, clouds.
Read ArticleBest Slug Matching Regex
From Stackoverflow
|
1 2 3 4 5 6 7 |
/^ [a-z0-9]+ # One or more repetition of given characters (?: # A non-capture group. - # A hyphen [a-z0-9]+ # One or more repetition of given characters )* # Zero or more repetition of previous group $/ |
or short
|
1 |
/^[a-z0-9]+(?:-[a-z0-9]+)*$/ |
Go version
|
1 |
var slugRegex = regexp.MustCompile(`^[a-z0-9]+(?:-[a-z0-9]+)*$`) |