Skip to content

Instantly share code, notes, and snippets.

View kjk's full-sized avatar

Krzysztof Kowalczyk kjk

View GitHub Profile
@kjk
kjk / chromedp_bug.go
Created July 24, 2019 20:17
chromedp bug
package main
import (
"context"
"fmt"
"net/url"
"time"
"github.com/chromedp/cdproto/cdp"
"github.com/chromedp/chromedp"
@kjk
kjk / main.go
Last active October 30, 2019 11:58
test goldmark markdown
package main
import (
"bytes"
"fmt"
"github.com/yuin/goldmark"
"github.com/yuin/goldmark/extension"
)
func main() {
@kjk
kjk / sumatranotes.txt
Last active October 31, 2019 21:31
notes from sumatra mupdf upgrade
fz_add_text => fz_add_text_span
removed symbols from libmupdf.def:
fz_analyze_text
fz_keep_transfer_function
fz_drop_transfer_function
fz_apply_transfer_function
fz_buffer_cat
fz_buffer_printf
fz_buffer_vprintf
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
@kjk
kjk / main.txt
Last active November 3, 2019 05:46
presstige crash
crashing page: 797e50e47c5a4fe8a0dbf9f7828a6192
Nov 02 13:30:38 ubuntu-s-2vcpu-4gb-nyc3-01 presstige[854]: net/http/server.go:2927 +0x38e
Nov 02 13:30:38 ubuntu-s-2vcpu-4gb-nyc3-01 presstige[854]: created by net/http.(*Server).Serve
Nov 02 13:30:38 ubuntu-s-2vcpu-4gb-nyc3-01 presstige[854]: net/http/server.go:1915 +0x9e0
Nov 02 13:30:38 ubuntu-s-2vcpu-4gb-nyc3-01 presstige[854]: net/http.(*conn).serve(0xc000488500, 0xcb7180, 0xc001356600)
Nov 02 13:30:38 ubuntu-s-2vcpu-4gb-nyc3-01 presstige[854]: bufio/bufio.go:138 +0x4f
Nov 02 13:30:38 ubuntu-s-2vcpu-4gb-nyc3-01 presstige[854]: bufio.(*Reader).Peek(0xc0013640c0, 0x4, 0x1596aaa6edd3, 0x116af80, 0x0, 0x0, 0x116af80)
Nov 02 13:30:38 ubuntu-s-2vcpu-4gb-nyc3-01 presstige[854]: bufio/bufio.go:100 +0x103
Nov 02 13:30:38 ubuntu-s-2vcpu-4gb-nyc3-01 presstige[854]: bufio.(*Reader).fill(0xc0013640c0)
"c:\Users\kjk\Desktop\sum test\tst.pdf" -extract-text -1
@kjk
kjk / main.go
Last active November 5, 2019 08:17
command line arguments
// :run go run main.go -echo echo-arg additional arg
// :collection Essential Go
package main
import (
"flag"
"fmt"
"os"
)
@kjk
kjk / main.go
Created November 5, 2019 09:07
Serialize struct as JSON
// collection: Essential Go
package main
import (
"encoding/json"
"fmt"
"log"
)
// :show start
@kjk
kjk / main.go
Created November 5, 2019 09:08
Parse JSON into a struct
// :collection Essential Go
package main
import (
"encoding/json"
"fmt"
"log"
)
// :show start
@kjk
kjk / main.go
Created November 5, 2019 09:12
Pointers
// :collection Essential Go
package main
import "fmt"
func main() {
// :show start
v := 5
// pv is a pointer to v