This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package echopprof | |
import ( | |
"github.com/labstack/echo/v4" | |
"net/http" | |
"net/http/pprof" | |
"sync" | |
) | |
type customEchoHandler struct { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func IterMethod() string { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RECOMMENDED READING | |
# https://lotabout.me/2018/Weighted-Random-Sampling/ | |
# https://www.cnblogs.com/UnGeek/p/5917995.html | |
import random | |
import collections as coll | |
data = {"A": 2, "B": 2, "C": 4, "D": 6, "E": 11} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://tools.ietf.org/html/rfc4226 | |
# http://tools.ietf.org/html/rfc6238 | |
import hmac | |
import base64 | |
import struct | |
import hashlib | |
import time | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"crypto/hmac" | |
"crypto/sha1" | |
"encoding/base32" | |
"fmt" | |
"os" | |
"strings" | |
"time" |