折腾linux桌面
人生的意义在于折腾,人不折腾,和咸鱼还有啥区别。 :)
玩了一个通宵,看上去差不多了。
人生的意义在于折腾,人不折腾,和咸鱼还有啥区别。 :)
玩了一个通宵,看上去差不多了。
终端上扫用户的付款码,肯定没清键盘缓冲。。。所以,微信的付款码36位72位什么的全来了。。偏偏终端的哥们兼职的,只星期天处理公事。
能怎么样,擦屁股呗。。
{"level":"DEBUG","time":"2024-04-02T15:32:39.662+0800","app_id":"xxxxxxxx","msg":"placeorder: cartdata:xxxxxxx,amount:2500,barcode:131014308497832446131014308497832446"}
if len(barcode) > 18 && len(barcode)%18 == 0 {
times18 := len(barcode) / 18
log.Log.Debugf("[%s] Buggy! Barcode is %d times 18, cutting it to 18", orderno, times18)
barcode = barcode[(times18-1)*18 : times18*18]
}
太方便了,我以前居然不知道,还得让gpt教我
type Config struct {
Database struct {
User string `yaml:"user"`
} `yaml:"database"`
}
var GlobalConfig Config
executablePath, _ := os.Executable()
yamlPath := filepath.Join(filepath.Dir(executablePath), "xxxx.yaml")
yamlFile, _ := os.ReadFile(yamlPath)
yaml.Unmarshal(yamlFile, &GlobalConfig)
fmt.Printf("User: %s\n",GlobalConfig.Database.User)
平时很反感这个,不过受不住低价的诱惑啊。
以前一直用阿里香港轻量一个月的24的机器(2C1G)来做跳板访问国内机器。这罗永浩直播,168一年,2C4G,虽然带宽只有5M,不过我就ssh什么的,5M够了。等于1个月便宜了10块,内存还多了3G,1G装个lnmp都够呛,4G就妥妥的。价格绝对值不多,比例大啊。
在github copilot配合加成下,改得还蛮快的。
sqlx没啥不好,我只不过就想用用gorm,和前些年刚好想反,当时是不用gorm用sqlx。
闲,都是闲出来的。