Skip to content

Instantly share code, notes, and snippets.

View mrbardia72's full-sized avatar
👑
Focusing

Bardia Kazemi mrbardia72

👑
Focusing
View GitHub Profile
@Ja7ad
Ja7ad / GoStrategy.md
Last active April 7, 2021 07:07
Go Project Management Strategy

Project Creator

create project and management with go modules

Intitial your project

  1. go to GOPATH in local cd $GOPATH
  2. if not having src,bin,pkg folder , create they mkdir -p {src,bin,pkg}
  3. go to src folder cd src
  4. create repository your project in github
  5. create folder mkdir -p github.com/username
    • change username to your username
@oleg-schelkunov
oleg-schelkunov / dummy.go
Last active June 23, 2024 15:37
Examples of HTTP mocks in Golang
package dummy
import (
"fmt"
"github.com/go-resty/resty/v2"
)
type XMLDummy struct {
Name string `xml:"Name"`
}
@harrietty
harrietty / Golang_Regex_Cheatsheet.md
Last active April 2, 2024 10:49
Golang Regex Cheatsheet

Golang Regex Cheatsheet

Using the regexp package

Include in the imports:

import "regexp"
@Mattemagikern
Mattemagikern / Certificates.go
Created May 9, 2019 08:31
Create x509 certificate chain using Golang. Root CA, Designated CA, server CA
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
@mfuerstenau
mfuerstenau / zigzag-encoding.README
Last active July 1, 2024 17:19
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation