Skip to content

Instantly share code, notes, and snippets.

View 8tomat8's full-sized avatar
🦖
Clapping t-rex

Borys Hulii 8tomat8

🦖
Clapping t-rex
View GitHub Profile
@fkurz
fkurz / mermaid-image-export.md
Last active January 11, 2024 12:35
Mermaid Diagram Image Export

We can export a mermaid diagram to PNG very simply using the official Mermaid CLI Tool.

Installation via npm

npm i -g mermaid.cli

Usage:

// See http://ppanyukov.github.io/2017/02/01/golang-with-vsts-repos.html
package main
import (
"strings"
"fmt"
"os"
"log"
"net/http"
Byobu is a suite of enhancements to tmux, as a command line
tool providing live system status, dynamic window management,
and some convenient keybindings:
F1 * Used by X11 *
Shift-F1 Display this help
F2 Create a new window
Shift-F2 Create a horizontal split
Ctrl-F2 Create a vertical split
Ctrl-Shift-F2 Create a new session
@saggit
saggit / main.go
Created June 14, 2015 12:57
Go implement werkzeug generate_password_hash check_password_hash with help of golang.org/x/crypto/pbkdf2 package
package main
import (
"crypto/rand"
"crypto/sha1"
"encoding/hex"
"fmt"
"golang.org/x/crypto/pbkdf2"
"strings"
)
@tmilos
tmilos / README.md
Last active March 18, 2024 05:34
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

// MIT license (c) andelf 2013
import (
"net/smtp"
"errors"
)
type loginAuth struct {
username, password string
KEYBINDINGS
byobu keybindings can be user defined in /usr/share/byobu/keybindings/ (or within .screenrc if byobu-export was used). The common key bindings
are:
F2 - Create a new window
F3 - Move to previous window
F4 - Move to next window
@jd-boyd
jd-boyd / jsonpp.go
Last active November 28, 2021 06:30
A Json pretty printer written in golang.
//Build with: go build ./jsonpp.go
package main
import "encoding/json"
import "fmt"
import "io/ioutil"
import "os"
@sergiotapia
sergiotapia / md5-example.go
Last active December 5, 2023 03:53
Golang - How to hash a string using MD5.
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}