Skip to content

Instantly share code, notes, and snippets.

View einsitang's full-sized avatar
🏠
Working at home

爱因斯唐 einsitang

🏠
Working at home
View GitHub Profile
@einsitang
einsitang / gist:b36b6238a01d7cfab2a073b1b131b202
Created December 19, 2024 08:35
macos screen setting script
Install displayplacer
https://github.com/jakehilborn/displayplacer
Install via Homebrew with:
#> brew tap jakehilborn/jakehilborn && brew install displayplacer
If you don't have Homebrew installed, you can install displayplacer from their releases tab:
https://github.com/jakehilborn/displayplacer/releases
After the install is completed, set up your monitors how you would normally have them in your normal every day non-rotated arrangement, and then run the command:
@einsitang
einsitang / a.go
Last active June 5, 2023 13:53
go 泛型歧义
package test
type Handler func(str string) string
type FuncMap map[string]Handler
func aDo() {
p := "message"
S := "key"
Fn := make(FuncMap)
// 这里的[]是取下标
@einsitang
einsitang / pow.js
Created June 3, 2023 16:39
proof-of-work
// 使用前先安装 md5 模块 : npm install md5
const md5 = require("md5")
// 时间戳截取长度 , 从后向前截取
const LENGTH = 6
// check proof of work data
const checkPow = (randomTxt, timestamp) => {
let [numStr] = getTimeState(timestamp)
let randMd5Str = md5(randomTxt)