Skip to content

Instantly share code, notes, and snippets.

View beejjorgensen's full-sized avatar
🐇
Doin' things!

Brian "Beej Jorgensen" Hall beejjorgensen

🐇
Doin' things!
View GitHub Profile
@beejjorgensen
beejjorgensen / c
Last active October 11, 2022 19:12
A simple command line calculator, wrapper around Python
#!/usr/bin/env python
#
# A command line calculator
#
# Just a wrapper around Python
#
# Put the expression in single quotes if it contains special shell
# characters.
#
def line_segment_intersect(x1, y1, x2, y2, x3, y3, x4, y4):
"""
Compute line segment intersection.
Line 1: (x1, y1) to (x2, y2)
Line 2: (x3, y3) to (x4, y4)
returns intersection (px, py)
returns None with no intersection.
@beejjorgensen
beejjorgensen / webserver.go
Last active October 28, 2018 17:33
Super-simple logging webserver
package main
import (
"log"
"net/http"
)
func logf(handler http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
log.Printf("%s %s %s", r.RemoteAddr, r.Method, r.URL)

Keybase proof

I hereby claim:

  • I am beejjorgensen on github.
  • I am beej (https://keybase.io/beej) on keybase.
  • I have a public key ASCiX3ExlcEy-50-gU3UZLrLUvJHDwbo0FmsV5hXrCb7two

To claim this, I am signing this object: