Skip to content

Instantly share code, notes, and snippets.

View groveriffic's full-sized avatar

Sam Ehlers groveriffic

View GitHub Profile
@groveriffic
groveriffic / curl_syntax.py
Created October 1, 2018 16:26
Prints out a command line curl from the same inputs your would have used with requests
def curl_syntax(url, params=[], headers=[]):
print(url, params, headers)
from urllib.parse import urlencode
print('curl \\')
print(' --verbose \\')
for k in sorted(headers.keys()):
v = headers[k]
print(' --header "{}: {}" \\'.format(k, v))
params_array = []
for k in sorted(params.keys()):
@groveriffic
groveriffic / unit_circle.html
Created March 16, 2017 19:02
Using the stock web stack to refresh my understanding of Trigonometry
<html>
<head>
<title>Trigonometry in the Unit Circle</title>
<style>
circle, line {
fill: none;
stroke: black;
stroke-width: 0.01;
}
@groveriffic
groveriffic / affine_edit.elm
Last active December 4, 2015 23:00
Edit affine transformations with mouse and keyboard in Elm
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Mouse
import Keyboard
import Char
import Signal
import Transform2D
import Time
package main
import (
"fmt"
"log"
)
type point struct {
x int
y int
package main
import (
"fmt"
"log"
)
// String Concatenation Monoid
var identity string = ""
var mappend = func(a, b string) string {
package main
import (
"fmt"
"log"
)
// A monoid that combines sum and count to calculate an average
type average struct {
sum int
package main
import (
"fmt"
"log"
)
// Product monoid
var identity int = 1
var mappend = func(a, b int) int {
@groveriffic
groveriffic / sum_monoid.go
Last active October 15, 2015 20:22
Demonstrates a trivial sum monoid in Go.
package main
import (
"fmt"
"log"
)
// Sum monoid
var identity int = 0
var mappend = func(a, b int) int {
package ids
import (
"fmt"
"testing"
"testing/quick"
)
func ExampleMarshalString() {
fmt.Print("\n")

Keybase proof

I hereby claim:

  • I am groveriffic on github.
  • I am groveriffic (https://keybase.io/groveriffic) on keybase.
  • I have a public key whose fingerprint is D2BE D5ED DAF4 7485 A60C 63B1 FE4C 0459 2039 63AA

To claim this, I am signing this object: