Skip to content

Instantly share code, notes, and snippets.

View kjk's full-sized avatar

Krzysztof Kowalczyk kjk

View GitHub Profile
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
// :collection Essential Go
package main
import (
"fmt"
"sync"
)
// :show start
var wg sync.WaitGroup
@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
@kjk
kjk / main.go
Created November 5, 2019 09:13
Error handling
// :collection Essential Go
package main
import (
"fmt"
"math"
)
// :show start
func sqrt(n float64) (float64, error) {
@kjk
kjk / main.go
Created November 5, 2019 09:21
Mutex
// :collection Essential Go
package main
import (
"fmt"
"sync"
"time"
)
// :show start