Skip to content

Instantly share code, notes, and snippets.

View lhlyu's full-sized avatar
:octocat:
sudo rm -rf /*

谕℃ lhlyu

:octocat:
sudo rm -rf /*
  • Gakuen Toshi
  • Akari, China
  • 13:28 (UTC +08:00)
View GitHub Profile
@lhlyu
lhlyu / git_log_format.sh
Created October 20, 2021 09:03
git提交日志格式化
git log --pretty=format:'√ %s %C(bold blue)<%an>%Creset %cr' --abbrev-commit --date=relative --no-merges -5
@lhlyu
lhlyu / kubeLog.sh
Last active December 16, 2021 11:16
本地查看容器日志
#!/bin/bash
ctx=$(kubectl config current-context)
namespace=$(kubectl config view --minify --output 'jsonpath={..namespace}'; echo)
echo $ctx $namespace
while true
@lhlyu
lhlyu / client.js
Last active February 2, 2023 08:21
微信小程序云开发 grpc simple & stream
// protoc ./*.proto --js_out=import_style=commonjs:./ --grpc-web_out=import_style=typescript,mode=grpcweb:./
var pb = require('./grpc_pb');
var svc = require('./grpc_grpc_pb');
var grpc = require('@grpc/grpc-js');
// 证书
const tls = `-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----`
@lhlyu
lhlyu / redis.md
Created July 1, 2021 07:25
redis通配符清理key

redis-cli -n 1 keys "keyword*" | xargs redis-cli -n 1 del

@lhlyu
lhlyu / demo.go
Last active April 29, 2021 11:23
优雅的并发请求
func Wrap(val *string,name string,timeout time.Duration) func() {
return func() {
time.Sleep(timeout)
*val = name
}
}
func main() {
for i := 97; i < 123; i++ {
go func(i int) {
@lhlyu
lhlyu / webchat_qrcode.go
Created February 26, 2020 03:05
微信生成二维码并上传至自己的服务器
// 生成二维码
// 参考文档: https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/qr-code/wxacode.createQRCode.html
const (
// 自己服务器上传图片的请求地址
upload_url = "http://localhost:8080/upload"
)
const (
// 获取token