This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
git diff -S 'TODO' HEAD | \ | |
grep -i '^+++\|^@@' | \ | |
sed -E 's/\+{3} b\///' | \ | |
sed -E 's/^@@ -[0-9]+,([0-9]+) \+[0-9]+,([0-9]+) @@$/\1 \2/' | \ | |
awk ' | |
{ | |
# NR starts at 1 | |
if (NR % 2 == 1) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dlv debug $GOPATH/src/github.com/go-delve/delve/cmd/dlv -- debug main.go --init dlvscript.txt | |
Type 'help' for list of commands. | |
(dlv) b proc/variables.go:840 | |
Breakpoint 1 set at 0x145e9e7 for github.com/go-delve/delve/pkg/proc.(*Variable).structMember() ./lib/go/src/github.com/go-delve/delve/pkg/proc/variables.go:840 | |
(dlv) c | |
WARN[0000] CGO_CFLAGS already set, Cgo code could be optimized. layer=dlv | |
Type 'help' for list of commands. | |
Breakpoint 1 set at 0x1057f66 for main.main() ./main.go:13 | |
> main.main() ./main.go:13 (hits goroutine(1):1 total:1) (PC: 0x1057f66) | |
8: } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://stackoverflow.com/questions/9556474/how-do-i-automatically-update-a-timestamp-in-postgresql/9556527#9556527 | |
-- https://dba.stackexchange.com/questions/9759/postgresql-multi-column-unique-constraint-and-null-values | |
-- this might be better as a view... | |
BEGIN; | |
CREATE OR REPLACE FUNCTION set_modified_column() | |
RETURNS TRIGGER AS $$ | |
BEGIN | |
NEW.modified = now(); | |
RETURN NEW; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"github.com/go-spatial/geom/encoding/mvt" | |
"github.com/go-spatial/geom/encoding/wkt" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
z | ε | |
0 | 156543.03 | |
1 | 78271.52 | |
2 | 39135.76 | |
3 | 19567.88 | |
4 | 9783.94 | |
5 | 4891.97 | |
6 | 2445.98 | |
7 | 1222.99 | |
8 | 611.50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%d!p/�T�!pHT6!pH�!t%�1!p t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PORT=8888 | |
echo "$@" | nc localhost $PORT | |
sleep 1 | |
nc localhost $PORT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
panic: runtime error: invalid memory address or nil pointer dereference [recovered] | |
panic: runtime error: invalid memory address or nil pointer dereference | |
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x467a656] | |
goroutine 407 [running]: | |
github.com/go-spatial/tegola/atlas.Map.Encode.func1.1.1(0xc0002e1aa0, 0xc000c67e00, 0xc0070f7358) | |
/Users/julio/lib/go/src/github.com/go-spatial/tegola/atlas/map.go:215 +0x505 | |
panic(0x49c0580, 0x527c920) | |
/usr/local/go/src/runtime/panic.go:679 +0x1b2 | |
github.com/go-spatial/geom/planar/triangulate/quadedge.(*QuadEdge).Sym(...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* can be run as like so: | |
* psql -d natural_earth -t -c "select 'CoastLine', ST_AsText(wkb_geometry) from ne_10m_coastline limit 1 offset 1;" | go run wkt_conv.go >> natural_earth.go | |
*/ | |
package main | |
import ( | |
"fmt" | |
"os" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// +build js | |
package websocket | |
import ( | |
"fmt" | |
"io" | |
"net" | |
"syscall/js" | |
"time" |