hi.
This file contains hidden or 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
| # ----------------------------------------------------------------------------- | |
| # AI-powered Git Commit Function | |
| # Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It: | |
| # 1) gets the current staged changed diff | |
| # 2) sends them to an LLM to write the git commit message | |
| # 3) allows you to easily accept, edit, regenerate, cancel | |
| # But - just read and edit the code however you like | |
| # the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/ | |
| gcm() { |
This file contains hidden or 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
| clickhouse client --host 127.0.0.1 --port 9000 --query="select * from DatabaseName.TableName1 FORMAT CSV" > /opt/clickhouse/backup/DatabaseName.TableName1.csv | |
| clickhouse client --host 127.0.0.1 --port 9000 --query="select * from DatabaseName.TableName2 FORMAT CSV" > /opt/clickhouse/backup/DatabaseName.TableName2.csv | |
| clickhouse client --host 127.0.0.1 --port 9000 --query="select * from DataBaseName.TableName3 FORMAT CSV" > /opt/clickhouse/backup/DataBaseName.TableName3.csv |
This file contains hidden or 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 | |
| func main() { | |
| ch := make(chan bool) | |
| ch <- true | |
| <-ch | |
| } |
This file contains hidden or 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" | |
| //func double(n int) { | |
| // n += n | |
| //} | |
| func double(n *int) { | |
| *n += *n |
go rpc demo
register master struct, all its function can be called.
This file contains hidden or 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" | |
| ) | |
| func check(e error, s string) { |
This file contains hidden or 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: | |
| go build -buildmode=plugin arithmetic.go | |
| go build calculate.go | |
| run: | |
| ./calculate |
This file contains hidden or 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
| run-server: | |
| go run server/server.go | |
| run-client: | |
| go run client/client.go |
NewerOlder