Skip to content

Instantly share code, notes, and snippets.

@morya
morya / ecb.go
Created March 23, 2017 15:49 — forked from yinheli/ecb.go
golang 标准库不支持 AES/ECB/PKCS5Padding issues: https://code.google.com/p/go/issues/detail?id=5597 别人的补丁. https://codereview.appspot.com/7860047/
package main
import (
"crypto/cipher"
)
type ecb struct {
b cipher.Block
blockSize int
}
@morya
morya / webserver.go
Created November 23, 2018 12:13
graceful stop web server in golang
package main
import (
"context"
"fmt"
"net"
"net/http"
)
func server1() {
@morya
morya / gist:769ab6cc146f4ee1fc18e1e4eba5a45c
Created March 30, 2019 13:06 — forked from ik5/gist:65de721ca495fa1bf451
golang, convert UTF-16 to UTF-8 string
package main
import "fmt"
import "unicode/utf16"
import "unicode/utf8"
import "bytes"
func main() {
b := []byte{
@morya
morya / gist:acfa64a3a7854a0ee4af4818ec7ca352
Created February 17, 2025 08:48
golive studio install script for nsis
; file saved with utf8-with-BOM
;
; NSIS Installer Script for OBS Studio, https://obsproject.com/
;
; This installer script is designed only for the release process
; of OBS Studio. It requires a lot of files to be in exactly the
; right places. If you're making a fork, it's strongly suggested
; that you make your own installer.
;
; If you choose to use this script anyway, be absolutely sure you