Skip to content

Instantly share code, notes, and snippets.

View barryz's full-sized avatar
💰
Focusing

penaldo barryz

💰
Focusing
View GitHub Profile
@barryz
barryz / aurora_archive.md
Created August 15, 2022 07:25
How to deploy an aurora full archive node

To deploy a full archive aurora rpc node, you need

  1. Completed a rpc node setup by following the instructions of aurora.
  2. Creating a script named download_archive_snapshot.sh which used to download archive snapshot.
#!/bin/sh
network="testnet"

if $(is-mainnet); then
@barryz
barryz / tgbot.go
Last active May 14, 2021 09:43
A telegram bot that reports traffic usage of Tencent lighthouse.
package main
import (
"context"
"fmt"
"log"
"strconv"
"strings"
"time"
@barryz
barryz / centered.md
Created December 24, 2019 01:53 — forked from ProjectCleverWeb/centered.md
Example of how to do centered text and images in Githb Flavored Markdown
package main
import (
"bytes"
"strings"
"testing"
)
func BenchmarkStringBuilder(b *testing.B) {
var bi strings.Builder
@barryz
barryz / go_echo_server.go
Last active March 8, 2018 14:10
golang implementation of echo server
package main
import (
"bufio"
"encoding/hex"
"log"
"net"
)
func main() {
@barryz
barryz / print_struct_tip.go
Last active February 12, 2018 10:07
Go tip for print struct
package main
import "fmt"
type Test struct {
Name string
Age int
}
func main() {
@barryz
barryz / cond_broadcast.go
Last active February 12, 2018 10:07
Go: condition variable broadcast example
package main
import (
"fmt"
"sync"
"time"
)
func main() {
var wg sync.WaitGroup
@barryz
barryz / channel_broadcast.go
Last active February 12, 2018 10:08
Go: example of channel broadcast
package main
import (
"fmt"
"time"
)
func main() {
done := make(chan struct{})
@barryz
barryz / typeAssert_test.go
Created January 26, 2018 14:33
Benchmark interface map and origin type map
package main
import (
"fmt"
"testing"
)
type Tester interface {
T() string
}
@barryz
barryz / log.go
Created December 15, 2017 11:09 — forked from Tantas/log.go
Apache access logs for golang.
import (
"fmt"
"io"
"net/http"
"strings"
"time"
)
// https://httpd.apache.org/docs/2.2/logs.html#combined + execution time.
const apacheFormatPattern = "%s - - [%s] \"%s %s %s\" %d %d \"%s\" \"%s\" %.4f\n"