Skip to content

Instantly share code, notes, and snippets.

@larsth
larsth / duoling.som_ds_bug
Created December 19, 2016 17:01
dulingo,com Discussion Stream: Cannot open another discussion stream in a new pane.
# Problem description
By default I, and I assume every one else, cannot open another "Discussion Stream" in a new pane.
# Expected behaviour
I can open a "New" Discussion Stream and/or a "Followed" Discussion Stream in a new browser pane from a "Popular" Discussion Stream.
The action is known as following a link on a HTML page.
@larsth
larsth / cmdgpsdtcpreader.go
Last active July 2, 2016 20:24
connect to gpsd daemon and retrive gpsd JSON documents via TCP
package main
import (
"bufio"
"fmt"
"log"
"net"
)
func main() {
@larsth
larsth / example_rmsgnogpsd_configuration_file
Last active November 4, 2015 12:46
rmsgnogpsd - example JSON configturation file
{
"tcp6host":"[::1]:10001",,
"wgs84_nogps":{
"latitude":55.69147,
"longitude":12.61681,
"altitude":2.01
}
}
@larsth
larsth / 20150509_spf_hugo_panic_nilpointer_dereference
Created May 8, 2015 23:26
2015-05-09: spf/hugo: hugo -v, Panic (nil pointer dereference)
hugo -v
INFO: 2015/05/09 Using config file: /home/lars/devel/website/www.larsth.dk/config.toml
INFO: 2015/05/09 syncing from /home/lars/devel/website/www.larsth.dk/themes/hyde-x/static to /home/lars/devel/website/larsth.github.io/
INFO: 2015/05/09 syncing from /home/lars/devel/website/www.larsth.dk/static/ to /home/lars/devel/website/larsth.github.io/
INFO: 2015/05/09 found taxonomies: map[string]string{"category":"kategorier"}
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x47ab4b]
goroutine 1 [running]:
@larsth
larsth / HaversinFormula.go
Last active August 29, 2015 14:19 — forked from cdipaolo/HaversinFormula.go
Distance Go/golang function that returns the distance (in meters) between two points of a given longitude and latitude relatively accurately.
// haversin(θ) function
func hsin(theta float64) float64 {
return math.Pow(math.Sin(theta/2), 2)
}
// Distance function returns the distance (in meters) between two points of
// a given longitude and latitude relatively accurately (using a spherical
// approximation of the Earth) through the Haversin Distance Formula for
// great arc distance on a sphere with accuracy for small distances
//