.
├── g
│ ├── cfg
│ │ ├── cfg.go
│ │ ├── cfg_test.go
│ │ └── testdata
│ └── lib.go
├── go.mod
├── go.sum
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/bash | |
# | |
# Show nth line with context 5 of each file | |
# | |
show_lines () | |
{ | |
local file n ctx min max lineno star | |
file=${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
// Worker pool example with input and output channel and multiple workers | |
// solves the deadlock caused by the r chanel not read on time, so blocking all | |
// worker on ri <- v | |
package main | |
import ( | |
"fmt" | |
"time" | |
"sync" |
.
├── g
│ ├── cfg
│ │ ├── cfg.go
│ │ ├── cfg_test.go
│ │ ├── go.mod
│ │ └── testdata
│ ├── go.mod
│ └── lib.go
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
// | |
// Stacking net/http handlers | |
// vyskocilm.github.io/blog | |
// | |
package main | |
import ( | |
"fmt" | |
"log" |
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
// | |
// simple net/http + cors.Cors integration | |
// vyskocilm.github.io/blog | |
// | |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" |
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" | |
"io/ioutil" | |
"log" | |
"os/exec" | |
) | |
// stress zproc for https://github.com/zeromq/czmq/issues/2007 |
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" | |
"github.com/cosmos72/gomacro/fast" | |
) | |
func RunGomacro(toeval string) float64 { | |
interp := fast.New() | |
vals, _ := interp.Eval(toeval) |
I hereby claim:
- I am vyskocilm on github.
- I am vyskocilm (https://keybase.io/vyskocilm) on keybase.
- I have a public key ASCXoesMzFaReZpJHNkdpt2RvK6efXKCv-EQ-Ef-W_6_SQo
To claim this, I am signing this object:
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 ( | |
"context" | |
"log" | |
"os" | |
"os/signal" | |
"sync" | |
"time" | |
) |