Skip to content

Instantly share code, notes, and snippets.

View lucas-code42's full-sized avatar
📖
learning

Lucas lucas-code42

📖
learning
  • Stone.co
  • São Paulo, SP
View GitHub Profile
@renanbastos93
renanbastos93 / error.go
Created December 30, 2023 22:39
Custom errors in Golang
// ./custom/error.go
package myerrors
import (
"fmt"
)
type myError struct {
code int
msg string
@pseudomuto
pseudomuto / main_1.go
Last active October 12, 2024 14:49
Blog Code: Clean SQL Transactions in Golang
package main
import (
"database/sql"
"log"
)
func main() {
db, err := sql.Open("VENDOR_HERE", "YOUR_DSN_HERE")
handleError(err)
@musale
musale / fix.md
Last active September 24, 2024 05:50
How to fix and recover a “corrupt history file” in zsh
# move to home directory
cd ~

# move the .zsh_history file into another .zsh_history_bad file
mv .zsh_history .zsh_history_bad

# write all printable strings into a new .zsh_history file
strings .zsh_history_bad > .zsh_history
@dedunumax
dedunumax / .gitignore Java
Last active October 24, 2024 04:44
A complete .gitignore file for Java.
##############################
## Java
##############################
.mtj.tmp/
*.class
*.jar
*.war
*.ear
*.nar
hs_err_pid*