Skip to content

Instantly share code, notes, and snippets.

View sh7ning's full-sized avatar
👊
Go !

Shine Yim sh7ning

👊
Go !
View GitHub Profile
@sh7ning
sh7ning / unsplash.py
Created September 3, 2019 22:19 — forked from ccbikai/unsplash.py
unsplash 全站下载脚本
# -*- coding: utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# unsplash 全站下载脚本
# 请先安装 requests ,BeautifulSoup
# pip install requests beautifulsoup4
# 运行 python unsplash.py
# 输入最小页数和最大页数
@sh7ning
sh7ning / google_translate.go
Created December 24, 2021 05:26 — forked from mojocn/google_translate.go
free open google translate of golang
import (
"context"
"crypto/tls"
"errors"
"fmt"
"github.com/abadojack/whatlanggo"
"io/ioutil"
"net/http"
"net/url"
@sh7ning
sh7ning / main.go
Created April 2, 2022 01:37 — forked from jiahuif/main.go
golang: tunnel tcp over socks5
package main
import (
"flag"
"io"
"net"
"time"
log "github.com/sirupsen/logrus"
"golang.org/x/net/proxy"
@sh7ning
sh7ning / golang_prometheus_metric_counter.go
Created May 10, 2022 08:59 — forked from ggzeng/golang_prometheus_metric_counter.go
prometheus golang 客户端中的各类metric写法
//step1:初始一个counter, with help string
pushCounter = prometheus.NewCounter(prometheus.CounterOpts{
Name: "repository_pushes",
Help: "Number of pushes to external repository.",
})
//setp2: 注册容器
err = prometheus.Register(pushCounter)
if err != nil {
fmt.Println("Push counter couldn't be registered AGAIN, no counting will happen:", err)