Skip to content

Instantly share code, notes, and snippets.

@nicklanng
nicklanng / spheretree.go
Last active October 18, 2022 19:44
My first attempt at implementing John Ratcliffe's Sphere Trees in go
package main
import (
"fmt"
"github.com/faiface/pixel"
"github.com/faiface/pixel/imdraw"
"github.com/faiface/pixel/pixelgl"
"github.com/faiface/pixel/text"
"golang.org/x/image/colornames"
"golang.org/x/image/font/basicfont"

Keybase proof

I hereby claim:

  • I am nicklanng on github.
  • I am nicklanng (https://keybase.io/nicklanng) on keybase.
  • I have a public key ASCXwczclyx3sZjB3h0VbXTIL_LMvGT9HZWcjLvHTsjRwwo

To claim this, I am signing this object:

package main
import (
"fmt"
"image"
"image/color"
"image/png"
"math"
"os"
@nicklanng
nicklanng / my_test.go
Created February 20, 2019 14:00
Interfaces vs Function Composition
package my_test
import "testing"
type AnInterface interface {
Update() int
}
type ImplementsInterface struct {
}
package lib
import (
"math"
)
const (
QuadTreeCapacity = 32
QuadTreeMaxDepth = 12
)
@nicklanng
nicklanng / main.go
Created February 20, 2018 21:58
adpcm
package main
// useful links
// http://wavefilegem.com/how_wave_files_work.html
// https://wiki.multimedia.cx/index.php/Microsoft_ADPCM
// https://github.com/bovarysme/adpcm/blob/master/status.go
import (
"bytes"
"encoding/binary"
<html>
<body>
Im an iframe!
<script>
console.log(window.parent.origin)
console.log(window.parent)
</script>
</body>
</html>
#!/bin/sh
if [ "$TERM" = "linux" ]; then
/bin/echo -e "
\e]P0050304
\e]P1181114
\e]P22d2227
\e]P3493941
\e]P46d5762
\e]P5997b89
\e]P6bdabb3
@nicklanng
nicklanng / semver.sh
Last active February 18, 2018 21:48
Semver for Travis CI based on Github Releases
if [ -z $TRAVIS_TAG ]; then
lastVersion=$(git tag -l --sort=v:refname *.*.* | tail -1)
if [ -z $lastVersion ]; then
lastVersion=0.0.0
fi
version=$lastVersion-dev
else
version=$TRAVIS_TAG
fi
@nicklanng
nicklanng / DarkBlueMediawiki.css
Created December 14, 2015 00:40
A modified version of the Wikipedia - Dark, blue, simple Stylish theme
html {
background: #000 !important;
}
/* main elements */
html > body,
table,
tbody,
tr,
td,