Skip to content

Instantly share code, notes, and snippets.

View x893675's full-sized avatar
:octocat:
🐳 ☸️

Hanamichi x893675

:octocat:
🐳 ☸️
View GitHub Profile
@x893675
x893675 / 📊 Weekly development breakdown
Last active November 30, 2024 01:55
📊 每周工作报告
Go 13 hrs 47 mins ████████████▍░░░░░░░░ 59.2%
YAML 6 hrs 33 mins █████▉░░░░░░░░░░░░░░░ 28.1%
Makefile 1 hr 49 mins █▋░░░░░░░░░░░░░░░░░░░ 7.8%
Bash 19 mins ▎░░░░░░░░░░░░░░░░░░░░ 1.4%
Markdown 13 mins ▏░░░░░░░░░░░░░░░░░░░░ 1.0%
@x893675
x893675 / 🎮 最近我在玩…
Last active November 30, 2024 01:54
🎮 Game Play
🚫 啊哦,最近好像没有玩过游戏呢
@x893675
x893675 / rawjson.go
Created July 22, 2020 09:22
response json raw message
package main
import (
"encoding/json"
"log"
"net/http"
)
type TestJson struct {
//Str is json string
package main
// docker client package version error, always import github.com/docker/docker v1.13.1
// Issue: https://github.com/moby/moby/issues/39302
import (
"context"
"fmt"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/client"
package main
// docker client package version error, always import github.com/docker/docker v1.13.1
// Issue: https://github.com/moby/moby/issues/39302
import (
"context"
"github.com/docker/docker/client"
"github.com/emicklei/go-restful"
"io"
"log"
@x893675
x893675 / golang-sse
Created August 17, 2020 03:07
server sent event
package main
import (
"fmt"
"log"
"net/http"
)
var messageChan chan string
@x893675
x893675 / bcrypt_password.go
Created September 3, 2020 07:49
store password by bcrypt
package main
import (
"golang.org/x/crypto/bcrypt"
"log"
)
// bcrypt主要由四部分组成
// Prefix说明了使用的bcrypt的版本
// Cost是进行哈希的次数-数字越大生成bcrypt的速度越慢,成本越大。同样也意味着如果密码库被盗,攻击者想通过暴力破解的方法猜测出用户密码的成本变得越昂贵。
package main
import (
"fmt"
"runtime"
"sync"
)
func main() {
testA()
package main
import (
"fmt"
"unsafe"
)
type StringHeader struct {
Data uintptr
Len int
package main
import "fmt"
type TreeNode struct {
Val int
Left *TreeNode
Right *TreeNode
}