Skip to content

Instantly share code, notes, and snippets.

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