Skip to content

Instantly share code, notes, and snippets.

View scbizu's full-sized avatar
🤗
用代码给大家带来笑容 Bring smiles with codes

Nace Sc scbizu

🤗
用代码给大家带来笑容 Bring smiles with codes
View GitHub Profile
@scbizu
scbizu / danmaku.js
Last active June 4, 2022 14:06
douyu danmaku
// ==UserScript==
// @name Douyu Danmu
// @namespace http://tampermonkey.net/
// @version 0.0.3
// @description try to take over the world!
// @author You
// @match *douyu.com*
// @grant none
// @include *www.douyu.com*
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am scbizu on github.
  • I am scnace (https://keybase.io/scnace) on keybase.
  • I have a public key ASBjBCRZ8h0L_Fh4QWlnjTRs6y0WkyoVduNoWDESPSk5ugo

To claim this, I am signing this object:

@scbizu
scbizu / crypto.go
Created May 29, 2019 14:02
crypto-js with go
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/md5"
crand "crypto/rand"
"encoding/base64"
"encoding/hex"
@scbizu
scbizu / gist:11c0a7276cefcece70d198ad34832804
Created April 25, 2019 02:10
Restore Chrome to light mode when Mac is set to Dark Mode
defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool yes
# more in https://support.google.com/chrome/thread/3395273?hl=en
@scbizu
scbizu / main.go
Last active March 14, 2019 18:40
A disque lock sample
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/zencoder/disque-go/disque"
)
@scbizu
scbizu / l2tpclient.sh
Created August 18, 2018 17:03 — forked from danielv99/l2tpclient.sh
L2TP VPN client on Linux Debian
# Requirements
# debian/ubuntu
apt-get -y update && apt-get -y upgrade
apt-get -y install strongswan xl2tpd libstrongswan-standard-plugins libstrongswan-extra-plugins
VPN_SERVER_IP=''
VPN_IPSEC_PSK='y'
VPN_USER=''
VPN_PASSWORD=''
@scbizu
scbizu / 1_simple.go
Created March 2, 2018 06:16 — forked from sosedoff/1_simple.go
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@scbizu
scbizu / ffmpeg
Created May 7, 2017 08:44 — forked from bnerd/ffmpeg
Encode RTMP input stream into multiple outputs with ffmpeg
ffmpeg -re -i rtmp://localhost/live/input_stream -acodec libfaac -ab 128k -vcodec libx264 -s 640x360 -b:v 500k -preset medium -vprofile baseline -r 25 -f flv rtmp://localhost/live/medium_500k -acodec libfaac -ab 128k -vcodec libx264 -s 480x272 -b:v 300k -preset medium -vprofile baseline -r 25 -f flv rtmp://localhost/live/medium_300k -acodec libfaac -ab 128k -c:v libx264 -s 320x200 -b:v 150k -preset:v fast -profile:v baseline -level 1.2 -r 25 -f flv rtmp://localhost/live/medium_150k -acodec libfaac -vn -ab 48k -f flv rtmp://localhost/live/audio_only
@scbizu
scbizu / revalid.go
Created March 7, 2017 12:49
How Golang solve the invalid UTF-8 character?
package main
import (
"fmt"
"unicode/utf8"
)
func main() {
s := "a\xc5z"
fmt.Printf("%q\n", s)
@scbizu
scbizu / quicksort.go
Created February 9, 2017 17:59
[QuickSort]QuickSort NlogN Golang implement
package sort
//SrcData ...
type SrcData struct {
Length int
Src []int
//Desc will sort Src by value Desc
Desc bool
}