Skip to content

Instantly share code, notes, and snippets.

View faddat's full-sized avatar

Jacob Gadikian faddat

View GitHub Profile
@sleepdefic1t
sleepdefic1t / MACOS_CLANG_TIDY.md
Last active March 21, 2024 13:52
brew clang-tidy on macOS
brew install llvm
ln -s "/usr/local/opt/llvm/bin/clang-format" "/usr/local/bin/clang-format"
ln -s "/usr/local/opt/llvm/bin/clang-tidy" "/usr/local/bin/clang-tidy"

use cmake file

  find_program(CLANG_TIDY_BIN clang-tidy)
 find_program(RUN_CLANG_TIDY_BIN /usr/local/Cellar/llvm/10.0.0_3/share/clang/run-clang-tidy.py)
[Unit]
Description=gaiad
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu
ExecStart=/home/ubuntu/go/bin/gaiad start
Restart=on-failure
@namnm
namnm / mining-pool-comparison.md
Created October 10, 2017 09:36
Mining pool comparison
@jrkt
jrkt / refactor.go
Last active February 27, 2023 18:35
Go - recursive find and replace based on file patterns
package main
func main() {
err := Refactor("oldString", "newString", "*.txt", "*.json)
if err != nil {
// handle error
}
}
func Refactor(old, new string, patterns ...string) error {
@zulhfreelancer
zulhfreelancer / install-docker.md
Last active April 25, 2024 02:35
Install Docker oneliner script

Just install Docker

$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh

Install Docker and Rancher Server

$ curl -fsSL get.docker.com -o get-docker.sh && sh get-docker.sh && sudo docker run -d --restart=unless-stopped -p 8080:8080 rancher/server

@posener
posener / go-shebang-story.md
Last active March 29, 2024 08:38
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.

@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
def signature
public_key_hex = @private_key.pub
ec = Bitcoin::OpenSSL_EC
digest_hex = digest.freeze
loop do
@expiration += 1
sig = ec.sign_compact(digest_hex, @private_key.priv, public_key_hex)
next if public_key_hex != ec.recover_compact(digest_hex, sig)
@faddat
faddat / glogchain.service
Last active February 5, 2017 12:58
Tendermint + glogchain systemd units
[Unit]
Description=Glogchain
[Service]
ExecStart=/root/.glogchain/glogchain
WorkingDirectory=/root/.glogchain
[Install]
WantedBy=multi-user.target