Skip to content

Instantly share code, notes, and snippets.

View rikkix's full-sized avatar
💭
Busy...

Rikki rikkix

💭
Busy...
View GitHub Profile
@rikkix
rikkix / RSAEncrypt.go
Created May 12, 2019 01:47
go RSA encrypt
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"io/ioutil"
"log"
)
@rikkix
rikkix / APIs.txt
Last active April 25, 2021 01:23
APIs
Google TTS:
https://www.google.com/speech-api/v1/synthesize?lang=en_US&client=EcoutezJsTts&text=EXAMPLE_TEXT
YTO:
curl 'http://www.yto.net.cn/api/trace/waybill' --data 'waybillNo=WAYBILL_NUM' --compressed
Netease Lyric:
https://music.163.com/api/song/lyric?id=MUSIC_ID&lv=-1&kv=-1&tv=-1
@rikkix
rikkix / AutoSnapshot.go
Last active August 1, 2019 10:03
Auto Snapshot for Vultr
package main
import (
"bytes"
"context"
"flag"
"fmt"
"github.com/vultr/govultr"
"io/ioutil"
"log"
@rikkix
rikkix / octToBin.go
Created October 26, 2019 11:56
Octal to binary
package main
import "fmt"
func main() {
fmt.Println(f(1)) // [1 0 0 0 0 0 0 0 0 0]
fmt.Println(f(7)) // [1 1 1 0 0 0 0 0 0 0]
fmt.Println(f(8)) // [0 0 0 1 0 0 0 0 0 0]
fmt.Println(f(255)) // [1 1 1 1 1 1 1 1 0 0]
fmt.Println(f(1023)) // [1 1 1 1 1 1 1 1 1 1]

Keybase proof

I hereby claim:

  • I am iochen on github.
  • I am iochen (https://keybase.io/iochen) on keybase.
  • I have a public key ASD9aFflNmVhWQZ5gUbHzJxJ_meAYpQcMLlvadgZueAUGAo

To claim this, I am signing this object:

@rikkix
rikkix / TCPChatRoom.go
Last active September 15, 2021 15:45
A simple TCP chat room with go(lang).
/*
Simple TCP chat room
start with arg
-l ADDRESS:PORT
you can use nc as client, by
nc ADDRESS PORT
-------------------------------------
package main
import "fmt"
func Collatz(i uint64, round int) int {
if i < 2 {
return round
}
if i%2 == 0 {
-----BEGIN PGP PUBLIC KEY BLOCK-----
mJMEXjY9yRMFK4EEACMEIwQBufF78MZUX26sE7HGp4ZR2hq/pVKunJpjP1mEzIza
bzYB8bo7qc0cocSAiRgZn4BjkuypAA/zqhM7pALXStAmBksAGN0TcmsZCzqUgcM5
LMKqJT/6AiGSoTp0weMAVSFhXNPRtF6HaryRSFRQxQY98RNKC9/RaSUbAt/kfZ50
sU0iL4u0IlJpY2hhcmQgQ2hlbiA8aW9jaGVuY29tQGdtYWlsLmNvbT6I2gQTEwoA
PhYhBNjv9sclDPc3lxCmgL2Bs/ua7DlRBQJeNj3JAhsDBQkLRzUABQsJCAcCBhUK
CQgLAgQWAgMBAh4BAheAAAoJEL2Bs/ua7DlRv18CCQEXYvnVdK2IkHqhvkcINYWZ
60TxBQiGq1TK9WNlqd0s9Xap77YXuJFpQ001A9XOiyUKibAOtXKmvSTgtuwn6Tn3
PgIJAQ26tj4MxTsgU6zLmNCl8WaA2s/aNev9fcrzd0EpfF8fmNu13+I1vJr7ABAR
@rikkix
rikkix / transform.go
Created October 16, 2020 13:30
golang png alpha channel issue
package hidden_test
import (
"image"
"image/color"
_ "image/jpeg"
"image/png"
"net/http"
"os"
"testing"
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"github.com/unidoc/unioffice/common"
"github.com/unidoc/unioffice/document"