Skip to content

Instantly share code, notes, and snippets.

View Double1996's full-sized avatar
🤒
Out sick

Forrest Shuang Double1996

🤒
Out sick
View GitHub Profile
@Double1996
Double1996 / golang_job_queue.md
Created June 29, 2022 09:36 — forked from harlow/golang_job_queue.md
Job queues in Golang
@Double1996
Double1996 / string.go
Created July 8, 2021 03:15
判断中文字符长度
func StrNum(str string) int {
str = strings.Replace(str, " ", "", -1)
// 去除换行符
str = strings.Replace(str, "\n", "", -1)
return utf8.RuneCountInString(str)
}
import subprocess
import re
# https://github.com/microsoft/WSL/issues/4210
def get_address_info():
s1 = subprocess.Popen(["ifconfig"], stdout=subprocess.PIPE)
out_string = s1.stdout.read().decode("utf-8")
@Double1996
Double1996 / nginx.conf
Created September 11, 2019 12:06
nginx
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
root /usr/share/nginx/html;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
@Double1996
Double1996 / server.go
Created May 31, 2019 02:20 — forked from josdirksen/server.go
Simple HTTP Server in Go using mongoDB and channels
package main
import (
"encoding/json"
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"io"
"math/rand"
"net/http"
@Double1996
Double1996 / file.go
Last active August 28, 2019 03:20
golang 各种操作数据库 #mongo #file
package main;
import (
"os"
"fmt"
"strconv"
)
func main() {