Skip to content

Instantly share code, notes, and snippets.

func boxed() -> [UnboxableDictionary] {
return flatMap {
guard let boxable = $0 as? Boxable else {
return nil
}
return boxable.boxed()
}
}
// or
@Boerworz
Boerworz / main.go
Last active August 14, 2024 06:41
Capturing the HTTP status code from http.ResponseWriter
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
// We need to cast handleRoot to a http.HandlerFunc since wrapHandlerWithLogging
@Boerworz
Boerworz / activate_frontmost.scpt
Created August 30, 2017 06:15
AppleScript to re-open the main window of almost any app
set applicationPath to (POSIX path of (path to frontmost application as text))
do shell script "open \"" & applicationPath & "\""