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
syntax = "proto3"; | |
package api.v1; | |
option go_package = "github.com/henvic/pgxtutorial/internal/apiv1/apipb"; | |
option java_multiple_files = true; | |
option java_outer_classname = "APIProto"; | |
option java_package = "api.v1"; | |
import "google/protobuf/empty.proto"; |
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
cheat() { | |
curl "https://cheat.sh/$1" | |
} | |
export GH_EDITOR="code" | |
export FZF_DEFAULT_COMMAND='ag -g ""' | |
ZSH_THEME="steeef" |
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
// HTTPLogger for https://github.com/henvic/httpretty | |
// to provide useful debugging info when running: | |
// $ DEBUG=api go run github.com/henvic/pgxtutorial/cmd/pgxtutorial | |
func HTTPLogger() func(http.Handler) http.Handler { | |
if !strings.Contains(os.Getenv("DEBUG"), "api") { | |
return nil | |
} | |
_, noColor := os.LookupEnv("NO_COLOR") // See https://no-color.org/ | |
if !noColor { | |
if fileInfo, _ := os.Stdout.Stat(); (fileInfo.Mode() & os.ModeCharDevice) == 0 { |
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 searchtest can be used to write integration tests with OpenSearch and search-replica. | |
// | |
// You can set the following environment variables to control logging: | |
// VERBOSE_OPENSEARCH=true to enable logging of requests and responses made with the OpenSearch client. | |
// VERBOSE_SEARCH_REPLICA=true to print verbose output from the search-replica process. | |
// | |
// Use If search-replica isn't on your $PATH or to run a different command, you can set the environment variable: | |
// SEARCH_REPLICA_COMMAND=search-replica | |
// | |
// search-replica works subscribing to a PostgreSQL publication using logical replication. |
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 postgres | |
import ( | |
"context" | |
"github.com/jackc/pgconn" | |
"github.com/jackc/pgx/v4" | |
"github.com/jackc/pgx/v4/pgxpool" | |
) |
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
func new11RandomID() string { | |
const ( | |
alphabet = "123456789ABCDEFGHJKLMNPQRSTUWVXYZabcdefghijkmnopqrstuwvxyz" // base58 | |
size = 11 | |
) | |
var id = make([]byte, size) | |
if _, err := rand.Read(id); err != nil { | |
panic(err) | |
} |
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
go tests are failing on the latest version of Go. | |
Still need to investigate. Using -race flag didn't detect any race condition, and this failure is happening with Mutual TLS. |
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
$ ./market | |
Usage: market <command> [flags] [arguments] | |
Commands: | |
serve run the market server | |
check-config check and print configuration | |
users manage users | |
Flags: | |
-config (string) configuration path (default "market.ini") |
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
set backspace=indent,eol,start | |
nnoremap <BS> X | |
if version >= 703 | |
set undofile | |
set undodir=$HOME/.vim/undo | |
set undolevels=1000 | |
set undoreload=10000 | |
endif |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>trustList</key> | |
<dict> | |
<key>027268293E5F5D17AAA4B3C3E6361E1F92575EAA</key> | |
<dict> | |
<key>issuerName</key> | |
<data> |
NewerOlder