-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.xml
executable file
·444 lines (348 loc) · 54.9 KB
/
index.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>代码笔记</title>
<link>https://glitterlip.github.io/</link>
<description>Recent content on 代码笔记</description>
<generator>Hugo -- gohugo.io</generator>
<language>zn-Hans</language>
<lastBuildDate>Fri, 06 Sep 2024 03:44:13 +0800</lastBuildDate><atom:link href="https://glitterlip.github.io/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Filamentphp</title>
<link>https://glitterlip.github.io/blog/2024-09/filamentphp/</link>
<pubDate>Fri, 06 Sep 2024 03:44:13 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2024-09/filamentphp/</guid>
<description>filamentphp 是可以修改代码自动刷新页面的,不仅是blade文件,resource文件也可以 同事做的项目初始化,我接手的时候,filament已经安装好了,无奈hot reload一直不行,每次改完都要按一下刷新,太难了 按照以下步骤检查了配置 env的APP_URL配置正确 vite的配置也对 import {defineConfig} from &#39;vite&#39;; import laravel from &#39;laravel-vite-plugin&#39;; export default defineConfig({ plugins: [ laravel({ input: [ &#39;resources/css/app.css&#39;, &#39;resources/js/app.js&#39;, &#39;resources/css/filament/admin/theme.css&#39; ], refresh: true, }), ], }); tailwindcss也没啥问题 import defaultTheme from &#39;tailwindcss/defaultTheme&#39;; import forms from &#39;@tailwindcss/forms&#39;; /** @type {import(&#39;tailwindcss&#39;).Config} */ export default { content: [ &#39;./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php&#39;, &#39;./storage/framework/views/*.php&#39;, &#39;./resources/views/**/*.blade.php&#39;, ],</description>
</item>
<item>
<title>Typeorm</title>
<link>https://glitterlip.github.io/blog/2024-07/typeorm/</link>
<pubDate>Thu, 25 Jul 2024 16:24:00 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2024-07/typeorm/</guid>
<description>在typeorm里orderby 使用 coalesce 函数 const q = this.announcementRepository.createQueryBuilder( &#39;announcement&#39;, ); q.orderBy(`COALESCE(announcement.scheduled_at, announcement.updated_at, announcement.created_at)`, &#39;DESC&#39;) //这么写 会报错 &#34;COALESCE(`announcement&#34; alias was not found. Maybe you forgot to join it? //要先addselect 添加alias 然后 q.orderBy(`COALESCE(announcement_scheduled_at, announcement_updated_at, announcement_created_at)`, &#39;DESC&#39;) 真的是无语了,为啥typeorm 连个orderByBaw的方法都没有,自带的raw方法返回的是FindOperator???</description>
</item>
<item>
<title>laravel tinker 方向键失效</title>
<link>https://glitterlip.github.io/blog/2023-12/laravel-tinker-%E6%96%B9%E5%90%91%E9%94%AE%E5%A4%B1%E6%95%88/</link>
<pubDate>Sun, 24 Dec 2023 20:12:36 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-12/laravel-tinker-%E6%96%B9%E5%90%91%E9%94%AE%E5%A4%B1%E6%95%88/</guid>
<description>本机用的zsh+iterm2,使用tinker时,是可以通过上下方向键查找历史命令,左右方向键移动光标的,奈何ssh到服务器就乱码了,每次都要edit使用vim来改,改完再保存执行,真的蛋疼. 具体是在tinker中 按上下左右方向键,出来的确是^[[A^[[B^[[D^[[C 乱码. 开始以为是iterm2的问题,因为之前碰到过iterm2 和 tmux 异常滚动的问题 改了几个参数没有效果&hellip;. 继续go</description>
</item>
<item>
<title>Livewirejs 404问题</title>
<link>https://glitterlip.github.io/blog/2023-10/livewirejs-404%E9%97%AE%E9%A2%98/</link>
<pubDate>Tue, 03 Oct 2023 00:06:23 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-10/livewirejs-404%E9%97%AE%E9%A2%98/</guid>
<description>laravel项目,装了filament作为后台,本地开发没问题,线上发布之后无法登录. 具体表现是点了登录按钮只是刷新页面,确认帐号密码是正确的. 打开控制台后资源加载报错/livewire/livewire.js not found php artisan route:list|grep livewire是有记录返回的 最后确定是nginx配置问题,当成静态文件去public目录找肯定是没有的,关闭缓存也不现实呢 location ~ .*\.(js|css)?$ { expires 12h; error_log /dev/null; access_log /dev/null; } 改成下面就可以了 location = /livewire/livewire.js { expires off; try_files $uri</description>
</item>
<item>
<title>Alpinejs 全局</title>
<link>https://glitterlip.github.io/blog/2023-09/alpinejs-%E5%85%A8%E5%B1%80/</link>
<pubDate>Wed, 13 Sep 2023 21:14:29 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-09/alpinejs-%E5%85%A8%E5%B1%80/</guid>
<description>把Alpinejs实例曝露到外部,控制台访问Alpinejs实例 &lt;div x-data=&#34;dropdown&#34;&gt; &lt;button @click=&#34;toggle&#34;&gt;...&lt;/button&gt; &lt;div x-show=&#34;open&#34;&gt;...&lt;/div&gt; &lt;/div&gt; &lt;script&gt; document.addEventListener(&#39;alpine:init&#39;, () =&gt; { Alpine.data(&#39;dropdown&#39;, () =&gt; ({ init(){ window.AlpApp = this }, open: false, toggle() { this.open = ! this.open } })) }) &lt;/script&gt; 这样页面里就可以打开控制台方便调试了console.log(window.AlpApp.$data.open) 不过拿到的是proxy,也可以这样获取 document.querySelectorAll(&#39;[x-data]&#39;).forEach(el =&gt; { console.log(el.__x.getUnobservedData()); });</description>
</item>
<item>
<title>Alpinejs 同时监听多个值</title>
<link>https://glitterlip.github.io/blog/2023-07/alpinejs-%E5%90%8C%E6%97%B6%E7%9B%91%E5%90%AC%E5%A4%9A%E4%B8%AA%E5%80%BC/</link>
<pubDate>Sun, 09 Jul 2023 15:33:26 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-07/alpinejs-%E5%90%8C%E6%97%B6%E7%9B%91%E5%90%AC%E5%A4%9A%E4%B8%AA%E5%80%BC/</guid>
<description>chatgpt给的错误答案 $watch([&#39;count&#39;, &#39;name&#39;], (newValues, oldValues) =&gt; {}) 上面的代码虽然可以监听到count和name的变化,但是newValues永远是count的值,name是无法拿到的 正确的写法是 Alpine.data(&#39;box&#39;, () =&gt; ({ init() { this.$watch(&#39;[first,last]&#39;, (v,oldV) =&gt; { console.log(v) this.name=`${v[0]} ${v[1]}` }) }, } )) chatgpt还给了这段代码监听,结果也是错的 &lt;script&gt; const app = Alpine.data(&#39;myComponent&#39;, () =&gt; ({ myData: &#39;Hello&#39; })); app.$watch(&#39;myData&#39;, (newValue, oldValue) =&gt; { console.log(`myData changed from ${oldValue} to ${newValue}`); }); &lt;/script&gt; Alpine.data方法根本就没有返回值,app是undefined,所以app.$watch是无效的,</description>
</item>
<item>
<title>Github 推送代码失败</title>
<link>https://glitterlip.github.io/blog/2023-06/github-%E6%8E%A8%E9%80%81%E4%BB%A3%E7%A0%81%E5%A4%B1%E8%B4%A5/</link>
<pubDate>Sat, 10 Jun 2023 20:43:26 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-06/github-%E6%8E%A8%E9%80%81%E4%BB%A3%E7%A0%81%E5%A4%B1%E8%B4%A5/</guid>
<description>周末在家写点代码,写完死活推不上去 kex_exchange_identification: Connection closed by remote host Connection closed by 198.18.0.16 port 22 fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 我以为是我挂了代理,github可能怀疑恶意用户不让我推代码。。。 实际是祖国更墙大了 Host github.com Hostname ssh.github.com Port 443 User git 把上面代码加入到~/.ssh/config就好了</description>
</item>
<item>
<title>Php 生成 Aws Pregisn Request</title>
<link>https://glitterlip.github.io/blog/2023-05/php-%E7%94%9F%E6%88%90-aws-pregisn-request/</link>
<pubDate>Thu, 04 May 2023 20:43:26 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-05/php-%E7%94%9F%E6%88%90-aws-pregisn-request/</guid>
<description>项目使用laravel开发,用bref部署到aws的lambda上,有一个上传文件的接口,由于lambda限制请求和响应大小为6mb,导致上传大于6mb的文件失败 这时候可以使用s3的presign post让前端直接上传到s3,presign post比presign url多了一个policy功能,你可以限制上传的文件大小,位置 $client = new S3Client([ &#39;version&#39; =&gt; &#39;latest&#39;, &#39;region&#39; =&gt; config(&#39;filesystems.disks.s3.region&#39;), ]); $bucket = config(&#39;filesystems.disks.s3.bucket&#39;); $temp_path = &#39;uploads/temp/images&#39;; $options = [ [&#39;bucket&#39; =&gt; $bucket], [&#39;content-length-range&#39; ,0, 20000000], //这里限制上传文件大</description>
</item>
<item>
<title>Ant Design Pro umijs 使用 Remixicon</title>
<link>https://glitterlip.github.io/blog/2023-03/ant-design-pro-umijs-%E4%BD%BF%E7%94%A8-remixicon/</link>
<pubDate>Sun, 26 Mar 2023 10:42:51 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-03/ant-design-pro-umijs-%E4%BD%BF%E7%94%A8-remixicon/</guid>
<description>开了个新项目,使用了 umijs,然后发现了一个好东西,就是 Remixicon,这个图标库,我觉得比 Ant Design 的图标库要好 copilot有点离谱了啊,上面那句话刚说完 「开了个新项目」,一按tab自动给我补全了,好家伙 在ant desgin/ant design pro/umijs项目中使用的话 yarn add remixicon 然后在src/global.less中 @import &#34;~remixicon/fonts/remixicon.css&#34;; 就好了</description>
</item>
<item>
<title>小程序真机播放音频失败</title>
<link>https://glitterlip.github.io/blog/2023-02/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%9C%9F%E6%9C%BA%E6%92%AD%E6%94%BE%E9%9F%B3%E9%A2%91%E5%A4%B1%E8%B4%A5/</link>
<pubDate>Wed, 22 Feb 2023 10:38:57 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-02/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E7%9C%9F%E6%9C%BA%E6%92%AD%E6%94%BE%E9%9F%B3%E9%A2%91%E5%A4%B1%E8%B4%A5/</guid>
<description>小程序android真机调试时播放音频失败,开发者工具是可以的 原代码 const innerAudioContext = Taro.createInnerAudioContext() innerAudioContext.autoplay = true innerAudioContext.loop = false innerAudioContext.src = `https://a.com/jpmp/api/voice` innerAudioContext.onError(e =&gt; { console.log(e) }) innerAudioContext.play() 出现的错误信息 {errCode: 10001, errMsg: &#34;errCode:62, err:load or init native decode so fail&#34;} 诡异的是域名已经白名单,开发时也可以播放,真机调试就是没声音 开始以为是mp3音频的编码格式手机不支持,不能解码无法播放,原始格式是audio-16khz-128kbitrate-mono-mp3,陆续换了 ogg-16khz-16bit-mono-opus webm-16khz-16bit-mono-opus riff-8khz-8bit-mono-alaw riff-8khz-8bit-mono-mulaw riff-8khz-16bit-mono-pcm 竟然没一个能播放的,webm,ogg都不支持</description>
</item>
<item>
<title>Taro小程序使用remixicon</title>
<link>https://glitterlip.github.io/blog/2023-02/taro%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%BD%BF%E7%94%A8remixicon/</link>
<pubDate>Sun, 19 Feb 2023 16:14:01 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-02/taro%E5%B0%8F%E7%A8%8B%E5%BA%8F%E4%BD%BF%E7%94%A8remixicon/</guid>
<description>taro开发小程序时,开发阶段使用图标字体没问题,真机预览后图标就不显示了 后来改成直接导入对应图标的svg,每次都要找svg图片就很烦,而且一放大字体也跟着变粗,看了下源文件也不大,打算直接放进项目里了 打开https://transfonter.org/上传woff2字体文件,选中base64编码 解压下载的文件夹,把stylesheet.css文件重命名为icon.less放到src下面,app.</description>
</item>
<item>
<title>Taro打包静态文件</title>
<link>https://glitterlip.github.io/blog/2023-02/taro%E6%89%93%E5%8C%85%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6/</link>
<pubDate>Sat, 11 Feb 2023 23:55:15 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-02/taro%E6%89%93%E5%8C%85%E9%9D%99%E6%80%81%E6%96%87%E4%BB%B6/</guid>
<description>小程序需要添加音效和背景音乐,网络加载会有一定延迟,音效文件也不大,直接打包进小程序 修改config/index.jx { ... copy: { patterns: [ { from: &#39;src/audio/&#39;, to: &#39;dist/audios/&#39;, ignore: [&#39;*.js&#39;] }, //把src下audio目录复制到编译后的dist/audios目录 ], options: { } } 点击按钮时播放音效 const click = () =&gt; { const innerAudioContext = Taro.createInnerAudioContext() innerAudioContext.autoplay = false innerAudioContext.loop = false innerAudioContext.src = `audios/test.mp3` innerAudioContext.play() }</description>
</item>
<item>
<title>屏蔽github搜索结果</title>
<link>https://glitterlip.github.io/blog/2023-02/%E5%B1%8F%E8%94%BDgithub%E6%90%9C%E7%B4%A2%E7%BB%93%E6%9E%9C/</link>
<pubDate>Fri, 10 Feb 2023 18:39:11 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-02/%E5%B1%8F%E8%94%BDgithub%E6%90%9C%E7%B4%A2%E7%BB%93%E6%9E%9C/</guid>
<description>每次github搜东西总有几个不相关的项目,github搜索结果一页就八条,那三个项目星星不少,每次都要看一遍再排除,真的麻烦 这次直接用adblock屏蔽掉 chrome装这个插件,支持自定义规则的adblock系插件应该都可以 然后自定义规则即可 github.com#?#li.repo-list-item.public.source:-abp-has(a:-abp-contains(cirosantilli)) github.com#?#li.repo-list-item.public.source:-abp-has(a:-abp-contains(Dujltqzv))[](https://) github.com#?#li.repo-list-item.public.source:-abp-has(a:-abp-contains(lTbgykio)) github.com#?#li.repo-list-item.public.source:-abp-has(a:-abp-contains(Don-Jimmy))</description>
</item>
<item>
<title>npm添加用户 登录时403错误</title>
<link>https://glitterlip.github.io/blog/2023-02/npm%E6%B7%BB%E5%8A%A0%E7%94%A8%E6%88%B7-%E7%99%BB%E5%BD%95%E6%97%B6403%E9%94%99%E8%AF%AF/</link>
<pubDate>Mon, 06 Feb 2023 11:53:51 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-02/npm%E6%B7%BB%E5%8A%A0%E7%94%A8%E6%88%B7-%E7%99%BB%E5%BD%95%E6%97%B6403%E9%94%99%E8%AF%AF/</guid>
<description>写了个包想发布到npm上,结果npm login/npm adduser的时候总是返回403错误 npm ERR! code E403 npm ERR! 403 403 Forbidden - PUT https://registry.npmmirror.com/-/user/org.couchdb.user:dogdayslast - [FORBIDDEN] Public registration is not allowed npm ERR! 403 In most cases, you or one of your dependencies are requesting npm ERR! 403 a package version that is forbidden by your security policy, or npm ERR! 403 on a server you do not have access to. npm ERR! A complete log of this run can be found in: npm ERR! /Users/bao/.npm/_logs/2023-02-06T03_42_04_150Z-debug-0.log 仔细检查了没有冲突的包名,第一次发布也没有版本冲突,命令行代理也关了,nvm也use了最新的npm版本,让我看日志也看了,连个error都没有 0 verbose cli [ 0 verbose cli &#39;/Users/bao/.nvm/versions/node/v16.15.0/bin/node&#39;, 0 verbose cli &#39;/Users/bao/.nvm/versions/node/v16.15.0/bin/npm&#39;, 0 verbose cli &#39;completion&#39;, 0</description>
</item>
<item>
<title>Laravel发送响应return后执行代码</title>
<link>https://glitterlip.github.io/blog/2023-01/laravel%E5%8F%91%E9%80%81%E5%93%8D%E5%BA%94return%E5%90%8E%E6%89%A7%E8%A1%8C%E4%BB%A3%E7%A0%81/</link>
<pubDate>Thu, 05 Jan 2023 16:45:57 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2023-01/laravel%E5%8F%91%E9%80%81%E5%93%8D%E5%BA%94return%E5%90%8E%E6%89%A7%E8%A1%8C%E4%BB%A3%E7%A0%81/</guid>
<description>有时候处理请求时,有些日志收尾工作,直接处理吧增加响应时间,建个job放队列处理又感觉没啥必要 比如记录访问者日志信息,我们会根据ip去调用go服务查询asn,country code,city,大致的经纬度,访问了资源会把访问次数+1 这两个任务开始的时候一个放队列处理,一个缓存访问量+1,差值达到阈值之后再保存落库。 Laravel的文档介绍了中间件的terminate方法,问题是可能还没开始处理请求</description>
</item>
<item>
<title>golang实现laravel的cache remember方法</title>
<link>https://glitterlip.github.io/blog/2022-12/golang%E5%AE%9E%E7%8E%B0laravel%E7%9A%84cache-remember%E6%96%B9%E6%B3%95/</link>
<pubDate>Tue, 27 Dec 2022 10:15:14 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-12/golang%E5%AE%9E%E7%8E%B0laravel%E7%9A%84cache-remember%E6%96%B9%E6%B3%95/</guid>
<description>怀念laravel的缓存,太方便了,用golang实现一下 安利一下这个包 gookit/cache type Cache interface { // basic operation Has(key string) bool Get(key string) interface{} Set(key string, val interface{}, ttl time.Duration) (err error) Del(key string) error // multi operation GetMulti(keys []string) map[string]interface{} SetMulti(values map[string]interface{}, ttl time.Duration) (err error) DelMulti(keys []string) error // clear and close Clear() error Close() error } 这个包通过适配各种常用的缓存驱动来提供统一的封装好的缓存操作方法。切换驱动只需要一行代码就行。 func Remember(ctx context.Context, pointer interface{}, key string, ttl time.Duration, cb func() error) error { if cache.Has(key) { //如果缓存有值,则反序列化 return Json.Unmarshal(cache.Get(key).([]byte), pointer) } else { //如果没有值,调用callback, err := cb() if err != nil { return err } /</description>
</item>
<item>
<title>Echo获取代理真实Ip</title>
<link>https://glitterlip.github.io/blog/2022-12/echo%E8%8E%B7%E5%8F%96%E4%BB%A3%E7%90%86%E7%9C%9F%E5%AE%9Eip/</link>
<pubDate>Mon, 19 Dec 2022 10:43:46 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-12/echo%E8%8E%B7%E5%8F%96%E4%BB%A3%E7%90%86%E7%9C%9F%E5%AE%9Eip/</guid>
<description>后端用的echo,前面分别挂了一台上海和香港的服务器做代理转发,反向代理之后获取不到真实IP _, n1, _ := net.ParseCIDR(&#34;110.42.x.x/32&#34;) //解析cidr拿到ipnet _, n2, _ := net.ParseCIDR(&#34;119.28.x.x/32&#34;) E.IPExtractor = echo.ExtractIPFromXFFHeader(echo.TrustIPRange(n1),echo.TrustIPRange(n2)) //设置代理的ip</description>
</item>
<item>
<title>javassist修改jar包</title>
<link>https://glitterlip.github.io/blog/2022-12/javassist%E4%BF%AE%E6%94%B9jar%E5%8C%85/</link>
<pubDate>Sun, 04 Dec 2022 02:25:06 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-12/javassist%E4%BF%AE%E6%94%B9jar%E5%8C%85/</guid>
<description>用aspose slide为ppt文件生成预览图片,生成图片有水印,可以用javassist修改jar包的方式来去除水印限制 pom文件 &lt;dependency&gt; &lt;groupId&gt;com.aspose&lt;/groupId&gt; &lt;artifactId&gt;aspose-slides&lt;/artifactId&gt; &lt;version&gt;22.9&lt;/version&gt; &lt;scope&gt;system&lt;/scope&gt; &lt;systemPath&gt;${project.basedir}/src/main/resources/lib/aspose-slides-22.9-jdk16.jar &lt;/systemPath&gt; &lt;classifier&gt;jdk16&lt;/classifier&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.javassist&lt;/groupId&gt; &lt;artifactId&gt;javassist&lt;/artifactId&gt; &lt;version&gt;3.28.0-GA&lt;/version&gt; &lt;/dependency&gt; 填个错的license试试 String license = &#34;&lt;License&gt;\n&#34; + &#34; &lt;Data&gt;\n&#34; + &#34; &lt;Products&gt;\n&#34; + &#34; &lt;Product&gt;Aspose.Total for Java&lt;/Product&gt;\n&#34; + &#34; &lt;Product&gt;Aspose.Words for Java&lt;/Product&gt;\n&#34; + &#34; &lt;/Products&gt;\n&#34; + &#34; &lt;EditionType&gt;Enterprise&lt;/EditionType&gt;\n&#34; + &#34; &lt;SubscriptionExpiry&gt;20991231&lt;/SubscriptionExpiry&gt;\n&#34; + &#34; &lt;LicenseExpiry&gt;20991231&lt;/LicenseExpiry&gt;\n&#34; + &#34; &lt;SerialNumber&gt;8bfe198c-7f0c-4ef8-8ff0-&lt;/SerialNumber&gt;\n&#34; + &#34; &lt;/Data&gt;\n&#34; + &#34;&lt;/License&gt;&#34;; InputStream is = new ByteArrayInputStream(license.getBytes(StandardCharsets.UTF_8)); License aposeLic = new License(); aposeLic.setLicense(is); 看看报错信息 2022-12-04 03:03:45.498 ERROR 63412 --- [nio-8091-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is class com.aspose.slides.exceptions.InvalidOperationException: License parsing error ---&gt; class com.aspose.slides.exceptions.InvalidOperationException: Signature check error. ---&gt; java.security.SignatureException: Signature length not correct: got 0 but was expecting 256 --- End</description>
</item>
<item>
<title>Aspose Slide 生成图片缩略图中文乱码</title>
<link>https://glitterlip.github.io/blog/2022-11/aspose-slide-%E7%94%9F%E6%88%90%E5%9B%BE%E7%89%87%E7%BC%A9%E7%95%A5%E5%9B%BE%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81/</link>
<pubDate>Tue, 15 Nov 2022 19:44:05 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-11/aspose-slide-%E7%94%9F%E6%88%90%E5%9B%BE%E7%89%87%E7%BC%A9%E7%95%A5%E5%9B%BE%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81/</guid>
<description>aspose slide生成图片缩略图中文乱码 使用aspose slide 给ppt生成图片缩略图,mac上没问题,部署到服务器上,生成的缩略图中文全部都是方块 把mac的字体传到服务器上还是不行,读取ppt时会出现 class com.aspose.slides.PptxReadException: Index 32 out of bounds for length 32 ---&gt; class com.aspose.slides.ms.pbdb106a0.bt com.aspose.slides.avm.do(Unknown Source) com.aspose.slides.Presentation.int(Unknown Source) com.aspose.slides.Presentation.if(Unknown Source) com.aspose.slides.Presentation.&lt;init&gt;(Unknown Source) com.aspose.slides.Presentation.&lt;init&gt;(Unknown Source) 这个错误,后来换成使用win10的字体可以了 centos7的步骤 把字体上传到 /usr/share/fonts/win 目录 cd /usr/share/fonts/win mkfontscale //建立索引 fc-cache //刷新缓存 fc-list //查看字体列表 fc-list :lang=zh</description>
</item>
<item>
<title>goquery 处理中文网页</title>
<link>https://glitterlip.github.io/blog/2022-11/goquery-%E5%A4%84%E7%90%86%E4%B8%AD%E6%96%87%E7%BD%91%E9%A1%B5/</link>
<pubDate>Wed, 09 Nov 2022 03:51:51 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-11/goquery-%E5%A4%84%E7%90%86%E4%B8%AD%E6%96%87%E7%BD%91%E9%A1%B5/</guid>
<description>&lt;meta http-equiv=&#34;Content-Type&#34; content=&#34;text/html; charset=gb2312&#34;&gt; 爬虫处理网页,标签用的gb2312字符集,goquery拿到的是乱码 刚开始用的 func DecodeToGBK2312(text string) string { dst := make([]byte, len(text)*2) tr := simplifiedchinese.HZGB2312.NewDecoder() nDst, _, _ := tr.Transform(dst, []byte(text), true) return string(dst[:nDst]) } 还是乱码。。。。 后来在wiki里找了一种方法 func detectContentCharset(body io.Reader) string { r := bufio.NewReader(body) if data, err := r.Peek(1024); err == nil { if _, name, ok := charset.DetermineEncoding(data, &#34;&#34;); ok { return name } } return &#34;utf-8&#34; } // DecodeHTMLBody returns an decoding reader of the html Body for the specified `charset` // If `charset` is empty, DecodeHTMLBody tries to guess the encoding from the content func DecodeHTMLBody(body io.Reader, charset string) (io.Reader, error) { if charset == &#34;&#34; { charset = detectContentCharset(body) } e, err := htmlindex.Get(charset) if err != nil { return nil, err } if name, _ := htmlindex.Name(e); name != &#34;utf-8&#34; { body = e.NewDecoder().Reader(body) } return body, nil } 试了下如果</description>
</item>
<item>
<title>1342</title>
<link>https://glitterlip.github.io/snippet/leetcode/1342/</link>
<pubDate>Mon, 07 Nov 2022 03:59:30 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/leetcode/1342/</guid>
<description>1342. Number of Steps to Reduce a Number to Zero 题目 Given an integer num, return the number of steps to reduce it to zero. In one step, if the current number is even, you have to divide it by 2, otherwise, you have to subtract 1 from it. Example 1: Input: num = 14 Output: 6 Explanation: Step 1) 14 is even; divide by 2 and obtain 7. Step 2) 7 is odd; subtract 1 and obtain 6. Step 3) 6 is even; divide by 2 and obtain 3. Step 4) 3 is odd; subtract 1 and obtain 2. Step 5) 2 is even; divide by 2 and obtain 1. Step 6) 1 is odd; subtract 1 and obtain 0. Example 2: Input: num = 8 Output: 4 Explanation: Step 1) 8 is even; divide by 2 and obtain 4. Step 2) 4 is even; divide by 2 and obtain 2. Step 3) 2 is even; divide by 2 and obtain 1. Step 4) 1 is odd; subtract 1 and obtain 0. Example 3: Input: num = 123 Output: 12 Constraints: 0 &lt;= num &lt;= 106 题目大意 给你一个数,偶数</description>
</item>
<item>
<title>412</title>
<link>https://glitterlip.github.io/snippet/leetcode/412/</link>
<pubDate>Sat, 05 Nov 2022 22:57:57 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/leetcode/412/</guid>
<description>412. Fizz Buzz 题目 Write a program that outputs the string representation of numbers from 1 to n. But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”. Example: n = 15, Return: [ &#34;1&#34;, &#34;2&#34;, &#34;Fizz&#34;, &#34;4&#34;, &#34;Buzz&#34;, &#34;Fizz&#34;, &#34;7&#34;, &#34;8&#34;, &#34;Fizz&#34;, &#34;Buzz&#34;, &#34;11&#34;, &#34;Fizz&#34;, &#34;13&#34;, &#34;14&#34;, &#34;FizzBuzz&#34; ] 题目大意 3的倍数输出 &ldquo;Fizz&rdquo;,5的倍数输出 &ldquo;Buzz&rdquo;,15的倍数输出 &ldquo;FizzBuzz&rdquo;,其他时候都输出原本的数字。 解题思路 按照题意</description>
</item>
<item>
<title>412</title>
<link>https://glitterlip.github.io/snippet/leetcode/876/</link>
<pubDate>Sat, 05 Nov 2022 22:57:57 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/leetcode/876/</guid>
<description>412. Fizz Buzz 题目 Given a non-empty, singly linked list with head node head, return a middle node of linked list. If there are two middle nodes, return the second middle node. Example 1: Input: [1,2,3,4,5] Output: Node 3 from this list (Serialization: [3,4,5]) The returned node has value 3. (The judge&#39;s serialization of this node is [3,4,5]). Note that we returned a ListNode object ans, such that: ans.val = 3, ans.next.val = 4, ans.next.next.val = 5, and ans.next.next.next = NULL. Example 2: Input: [1,2,3,4,5,6] Output: Node 4 from this list (Serialization: [4,5,6]) Since the list has two middle nodes with values 3 and 4, we return the second one. Note: The number of nodes in the given list will be between 1 and 100. 题目大意 输出链表中间结点。这题在前面题目中反复出现了很多次了。 如果链表长度是奇数,输出中间结点是中间结点。如果链表长度是双数,输出中间结点是中位数后</description>
</item>
<item>
<title>1672</title>
<link>https://glitterlip.github.io/snippet/leetcode/1672/</link>
<pubDate>Sat, 05 Nov 2022 00:05:15 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/leetcode/1672/</guid>
<description>1672. Richest Customer Wealth 题目 You are given an m x n integer grid accounts where accounts[i][j] is the amount of money the ith customer has in the jth bank. Return the wealth that the richest customer has. A customer&rsquo;s wealth is the amount of money they have in all their bank accounts. The richest customer is the customer that has the maximum wealth. Example 1: Input: accounts = [[1,2,3],[3,2,1]] Output: 6 Explanation:1st customer has wealth = 1 + 2 + 3 = 6 2nd customer has wealth = 3 + 2 + 1 = 6 Both customers are considered the richest with a wealth of 6 each, so return 6. Example 2: Input: accounts = [[1,5],[7,3],[3,5]] Output: 10 Explanation: 1st customer has wealth = 6 2nd customer has wealth = 10 3rd customer has wealth = 8 The 2nd customer is the richest with a wealth of 10. Example 3: Input: accounts = [[2,8,7],[7,1,3],[1,9,5]] Output: 17 Constraints: m == accounts.length n == accounts[i].length 1 &lt;= m, n &lt;= 50 1 &lt;= accounts[i][j] &lt;= 100 题目大意 给你一个 m x n 的整数网格 accounts ,其中 accounts[i][j] 是第 i</description>
</item>
<item>
<title>Qrcode React</title>
<link>https://glitterlip.github.io/snippet/qrcode-react/</link>
<pubDate>Thu, 03 Nov 2022 03:38:38 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/qrcode-react/</guid>
<description>download qrcode.react svg as png to fix Function components cannot be given refs. Attempts to access this ref will fail error
import React,{useRef} from &#39;react&#39;; import {QRCodeCanvas} from &#39;qrcode.react&#39; export function App(props) { const divRef = useRef(null); const download = () =&gt; { const node = divRef.current?.children[0]; if (node == null) { return; } const dataURI = node.toDataURL(&#39;image/png&#39;); let a = document.createElement(&#39;a&#39;); a.download = &#39;qrcode-canvas.png&#39;; a.href = dataURI; a.click(); }; return ( &lt;div className=&#39;App&#39;&gt; &lt;h1&gt;Hello React.&lt;/h1&gt; &lt;div className={&#39;mx-auto pt-2&#39;} ref={divRef}&gt; &lt;QRCodeCanvas value={&#34;https://playcode.io/react&#34;} /&gt; &lt;/div&gt; &lt;div className=&#39;mx-auto pt-2&#39;&gt; &lt;button onClick={download}&gt; Download &lt;/button&gt; &lt;/div&gt; &lt;/div&gt; ); } // Log to console console.log(&#39;Hello console&#39;); </description>
</item>
<item>
<title>fix Cloudflare R2 Network connection lost error</title>
<link>https://glitterlip.github.io/blog/2022-11/fix-cloudflare-r2-network-connection-lost-error/</link>
<pubDate>Tue, 01 Nov 2022 00:23:51 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-11/fix-cloudflare-r2-network-connection-lost-error/</guid>
<description>想白嫖下cloudflare的R2,workers上传文件的时候总是会出现Network connection lost error错误, 用的Hono包,完全照着cloudflare的官方文档抄 export const AddFile = async (c: Context): Promise&lt;Response&gt; =&gt; { //save object const data = await c.req.formData(); const file: File = data.get(&#34;file&#34;) as File; const name = await md5(file) as string; const bucket = c.env.DRIVE as R2Bucket try { const saved = await bucket.put(name, file, { httpMetadata: { contentType: file.type }, customMetadata: { createdAt: Date.now().toString(), } }) } catch (e) { console.log(e) return Error(c, CODE_CLOUDFLARE_SERVICE_FAILED, &#39;service unavailable,please try again later&#39;) } return Success(c, &#39;ok&#39;) } 结果总是网络链接断开,用wrangler还有网站的Real-time Logs 啥信息都看不出来</description>
</item>
<item>
<title>Laravel查看缓存剩余时间</title>
<link>https://glitterlip.github.io/blog/2022-10/laravel%E6%9F%A5%E7%9C%8B%E7%BC%93%E5%AD%98%E5%89%A9%E4%BD%99%E6%97%B6%E9%97%B4/</link>
<pubDate>Sat, 22 Oct 2022 16:44:28 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-10/laravel%E6%9F%A5%E7%9C%8B%E7%BC%93%E5%AD%98%E5%89%A9%E4%BD%99%E6%97%B6%E9%97%B4/</guid>
<description>laravel当配置redis为缓存时查看缓存的剩余时间 Laravel版本9.12 Laravel的缓存配置文件config/cache.php &#39;prefix&#39; =&gt; env(&#39;CACHE_PREFIX&#39;, Str::slug(env(&#39;APP_NAME&#39;, &#39;laravel&#39;), &#39;_&#39;).&#39;_cache&#39;) Laravel的数据库配置文件config/database.php &#39;redis&#39; =&gt; [ &#39;client&#39; =&gt; env(&#39;REDIS_CLIENT&#39;, &#39;phpredis&#39;), &#39;options&#39; =&gt; [ &#39;cluster&#39; =&gt; env(&#39;REDIS_CLUSTER&#39;, &#39;redis&#39;), &#39;prefix&#39; =&gt; env(&#39;REDIS_PREFIX&#39;, Str::slug(env(&#39;APP_NAME&#39;, &#39;laravel&#39;), &#39;_&#39;) . &#39;_database_&#39;), ], ] Laravel 缓存key的生成规则为config('database.redis.options.prefix').config('cache</description>
</item>
<item>
<title>grpc php客户端与golang服务端通信</title>
<link>https://glitterlip.github.io/blog/2022-10/grpc-php%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%B8%8Egolang%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%80%9A%E4%BF%A1/</link>
<pubDate>Sat, 15 Oct 2022 19:46:21 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-10/grpc-php%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%B8%8Egolang%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%80%9A%E4%BF%A1/</guid>
<description>版本 go version go1.19.1 darwin/arm64 protoc --version libprotoc 3.21.9 projectpath 代表项目根目录 Go服务端 初始化golang项目,编写proto文件 // projectpath/proto/link.proto syntax = &#34;proto3&#34;; package proto; option go_package = &#34;/proto&#34;; service Link{ rpc GetLink(GetLinkRequest) returns (GetLinkResponse){} } message GetLinkRequest{ int32 driver = 1; string linkId = 2; string token = 3; } message GetLinkResponse { int32 code = 1; string link = 2; string pwd = 3; } 安装所需工具 go install google.golang.org/protobuf/cmd/[email protected] //用于生成xx.pb.go文件 主要是link.proto里面的message对应的go代码 go install google.golang.org/grpc/cmd/[email protected] //用于生成xx_grpc.pb.go 即grpc服务的go版本服务端和客户端 //安装之后查看是否安</description>
</item>
<item>
<title>编写popclip扩展</title>
<link>https://glitterlip.github.io/blog/2022-10/%E7%BC%96%E5%86%99popclip%E6%89%A9%E5%B1%95/</link>
<pubDate>Mon, 10 Oct 2022 15:30:54 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-10/%E7%BC%96%E5%86%99popclip%E6%89%A9%E5%B1%95/</guid>
<description>最近网站碰到的爬虫有点多,经常需要查询ip的asn, 每次都要复制然后打开浏览器再粘贴。popclip有一个插件可以自动识别选中的文本里的网址并通过浏览器打开,想着自己改改弄一个扩展解放双手 新的popclip从PopClip 2021.11开始,支持一种简便的扩展编写方式 Extension Snippets ,只需要按照对应格式编写一个yaml配置文件,然后选中,在点击popclip弹出的install按钮即可 # popclip extension to check ip name: IP Check icon: search IP</description>
</item>
<item>
<title>ssh端口转发</title>
<link>https://glitterlip.github.io/blog/2022-10/ssh%E7%AB%AF%E5%8F%A3%E8%BD%AC%E5%8F%91/</link>
<pubDate>Thu, 06 Oct 2022 22:11:41 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-10/ssh%E7%AB%AF%E5%8F%A3%E8%BD%AC%E5%8F%91/</guid>
<description>ssh端口转发 本地端口转发 将发送到本机某个端口的请求转发给远程ssh服务器的某个端口 ssh -L [LOCAL_IP:]LOCAL_PORT:DESTINATION:DESTINATION_PORT [USER@]SSH_SERVER 比如服务器elk的kibana服务,mysql服务,Druid,nacos的管理端,rancher的管理端这些肯定是不能暴露给公网访问的 ssh -L -N 15601:127.0.0.1:5601 root@remoteip 这条命令会将发送到本机15601端口的请求转发到服务器的5601端口,在本机打开浏览器访问http://localhost:15601/即可访问服务器上部署的ki</description>
</item>
<item>
<title>Laravel Job添加telescope Tags</title>
<link>https://glitterlip.github.io/blog/2022-10/laravel-job%E6%B7%BB%E5%8A%A0telescope-tags/</link>
<pubDate>Sat, 01 Oct 2022 14:57:40 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-10/laravel-job%E6%B7%BB%E5%8A%A0telescope-tags/</guid>
<description>请求添加tag laravel开了telescope,请求添加tag还好说 //直接在TelescopeServiceProvider的register方法判断就好了 Telescope::tag(function (IncomingEntry $entry) { if ($entry-&gt;isRequest()){ $tags = []; $tags[] = preg_replace(&#39;/(\d+)\.(\d+)\.(\d+)\.(\d+)/&#39;, &#39;$1.$2.*.*&#39;, request()-&gt;getClientIp()); $tags[] = preg_replace(&#39;/(\d+)\.(\d+)\.(\d+)\.(\d+)/&#39;, &#39;$1.$2.$3.*&#39;, request()-&gt;getClientIp()); $tags[] = $t; if (! request()-&gt;header(&#39;referer&#39;) ) { $tags[] = &#39;noreferer&#39;; } return $tags; } }); job添加tag 想给job添加tag,而且需要根据job的数据添加tag,直接在job方法中新增一个tags方法即可 &lt;?php namespace App\Jobs; class XXJob implements ShouldQueue, ShouldBeUnique { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; public $id; public function __construct($id) { $this-&gt;id = $id; } public function</description>
</item>
<item>
<title>小程序加密网络通道,小程序aes加密</title>
<link>https://glitterlip.github.io/blog/2022-09/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%8A%A0%E5%AF%86%E7%BD%91%E7%BB%9C%E9%80%9A%E9%81%93%E5%B0%8F%E7%A8%8B%E5%BA%8Faes%E5%8A%A0%E5%AF%86/</link>
<pubDate>Thu, 29 Sep 2022 14:23:49 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-09/%E5%B0%8F%E7%A8%8B%E5%BA%8F%E5%8A%A0%E5%AF%86%E7%BD%91%E7%BB%9C%E9%80%9A%E9%81%93%E5%B0%8F%E7%A8%8B%E5%BA%8Faes%E5%8A%A0%E5%AF%86/</guid>
<description>为了防止小程序的接口被盗用,用了小程序的加密网络通道,前端使用cryptojs加密,报错Native crypto module could not be used to get secure random number. 结论 修改package.json,版本降级,&quot;crypto-js&quot;: &quot;3.1.9-1&quot;, 或者改成使用https://github.com/ricmoo/aes-js 原因 刚开始用的官方文档推荐的https://github.com/ricmoo/aes-js ,结果aes-cbc</description>
</item>
<item>
<title>Tailwind Missing</title>
<link>https://glitterlip.github.io/blog/2022-09/tailwind-missing/</link>
<pubDate>Wed, 28 Sep 2022 22:04:41 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-09/tailwind-missing/</guid>
<description>Tailwindcss 动态生成类名失效 用的reactjs和JedWatson/classnames这个包做一个随时间变化颜色的功能 const [colorCls, setColorCls] = useState&lt;string&gt;(&#39;green-400&#39;) &lt;span className={classNames(&#39;text-base font-extrabold&#39;, `text-${colorCls}`)}&gt;&lt;/span&gt; &lt;div className={classNames(&#39;p-4&#39;, `bg-${colorCls}`)}&gt;&lt;/span&gt; 类名正常生成了,但是css没生成 ,因为tailwindcss不支持动态生成的,即使开了jit模式也不行,必须在构建的时候被扫描到才行。 只能写全类名或者定义一个临时变量保存所有可能类名了</description>
</item>
<item>
<title>linux less命令</title>
<link>https://glitterlip.github.io/blog/2022-09/linux-less%E5%91%BD%E4%BB%A4/</link>
<pubDate>Wed, 28 Sep 2022 10:44:03 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-09/linux-less%E5%91%BD%E4%BB%A4/</guid>
<description>linux中的less命令 -G 移动到最后一页 -gg 第一页 -F 实时更新 -b 向上翻页 -空格 向下翻页 /kw 向后搜索kw ?kw 向前搜索kw 实时过滤 有时候查看nginx日志时,想查看爬虫抓取记录,可以在查看时输入&amp;bingbot|Googlebot|Baiduspider, &amp;后面接正则表达式,bingbot|Googlebot|Baiduspider表示过滤展示日志中行记录包含必应或者百度或者谷歌蜘蛛的记录,</description>
</item>
<item>
<title>gin打包html模板和静态资源文件</title>
<link>https://glitterlip.github.io/blog/2022-09/gin%E6%89%93%E5%8C%85html%E6%A8%A1%E6%9D%BF%E5%92%8C%E9%9D%99%E6%80%81%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6/</link>
<pubDate>Sun, 18 Sep 2022 01:26:18 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-09/gin%E6%89%93%E5%8C%85html%E6%A8%A1%E6%9D%BF%E5%92%8C%E9%9D%99%E6%80%81%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6/</guid>
<description>[GIN-debug] [WARNING] Since SetHTMLTemplate() is NOT thread-safe. It should only be called at initialization. ie. before any route is registered or the router is listening in a socket: router := gin.Default() router.SetHTMLTemplate(template) // &lt;&lt; good place Gin和Echo有点不一样,需要在注册路由之前注册模板 注册子目录的html文件 ├── go.mod ├── go.sum ├── app.go ├── resources │ ├── css │ │ └── input.css │ ├── js │ │ └── tailwind.config.js │ └── views │ ├── detail.html │ ├── home │ │ └── home.index.html │ └── search.html func walkDir(fileSystem embed.FS, path string) { _, err := T.ParseFS(fileSystem, path+&#34;/*.html&#34;) if err != nil { panic(fmt.Sprintf(&#34;parse error:%s&#34;, err.Error())) } entries, _ := fs.ReadDir(fileSystem, path) for _, entry := range entries { if entry.IsDir() { walkDir(fileSystem, path+&#34;/&#34;+entry.Name()) } } } T:=template.New(&#34;view&#34;) T.ParseFS(ResourcesFS, &#34;resources/views/*.html&#34;) entries, _ := ResourcesFS.ReadDir(&#34;resources/views&#34;) for _, entry := range entries { if entry.IsDir() { walkDir(ResourcesFS, &#34;resources/views/&#34;+entry.Name()) } }</description>
</item>
<item>
<title>umijs配置多环境</title>
<link>https://glitterlip.github.io/blog/2022-09/umijs%E9%85%8D%E7%BD%AE%E5%A4%9A%E7%8E%AF%E5%A2%83/</link>
<pubDate>Thu, 08 Sep 2022 10:03:58 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-09/umijs%E9%85%8D%E7%BD%AE%E5%A4%9A%E7%8E%AF%E5%A2%83/</guid>
<description>umijs配置多环境 es的index 使用yarn create umi创建的项目,版本[email protected] 首先修改package.json文件 { &#34;scripts&#34;: { &#34;build&#34;: &#34;UMI_ENV=prod max build&#34; } } 修改项目配置文件.umirc.ts import { defineConfig } from &#39;@umijs/max&#39;; const { UMI_ENV } = process.env; export default defineConfig({ define: { &#39;process.env.UMI_ENV&#39;: UMI_ENV, }, }); 在其他js文件中使用 export const BASEURL_HTTP = process.env.UMI_ENV == &#39;prod&#39; ? &#39;/&#39; : &#39;http://127.0.0.1:18083&#39;;</description>
</item>
<item>
<title>umijs Tailwindcss样式冲突</title>
<link>https://glitterlip.github.io/blog/2022-08/umijs-tailwindcss%E6%A0%B7%E5%BC%8F%E5%86%B2%E7%AA%81/</link>
<pubDate>Thu, 25 Aug 2022 20:56:00 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-08/umijs-tailwindcss%E6%A0%B7%E5%BC%8F%E5%86%B2%E7%AA%81/</guid>
<description>umi同时开启了tailwindcss和ant design插件,会导致样式冲突 可以在tailwindcss.css中关闭,只保留工具类即可 /*@tailwind base;*/ /*@tailwind components;*/ @tailwind utilities; 但是css动画在base里,开了base之后又会导致ant design按钮及其他组件样式覆盖 可以tailwind.config.js设置里关掉preflight module.exports = { content: [ &#39;./src/pages/**/*.tsx&#39;, &#39;./src/components/**.tsx&#39;, &#39;./src/layouts/**.tsx&#39;, ], corePlugins: { preflight: false, } }</description>
</item>
<item>
<title>Golang Echo,React Umijs 项目部署</title>
<link>https://glitterlip.github.io/blog/2022-08/golang-echoreact-umijs-%E9%A1%B9%E7%9B%AE%E9%83%A8%E7%BD%B2/</link>
<pubDate>Thu, 18 Aug 2022 15:30:31 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-08/golang-echoreact-umijs-%E9%A1%B9%E7%9B%AE%E9%83%A8%E7%BD%B2/</guid>
<description>nginx 配置文件 server { #强制https listen 80; listen [::]:80; server_name project.com; return 301 https://project.com$request_uri; } map $http_upgrade $connection_upgrade { default upgrade; &#39;&#39; close; } server { listen 443 ssl; ssl_certificate /etc/letsencrypt/live/project.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/project.com/privkey.pem; server_name project.com; #默认为umijs 构建产物 location / { root /data/project/project/public/dist; index index.html index.htm; try_files $uri $uri/ /index.html; } location /api { # golang后端api监听18081端口 proxy_pass http://127.0.0.1:18081/api; proxy_set_header Upgrade $http_upgrade; #websocket 链接 proxy_set_header Connection $connection_upgrade; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; } error_log /var/log/nginx/project_error.log; access_log /var/log/nginx/project_access.log; } k8s服务器在国内,这个项目服务器在香港,ci/cd的话直接上传构建产物了,git只作为代码追踪使用 golang echo 部署脚本 #! /bin/bash #打包压缩 GOOS=linux GOARCH=amd64 go build -o project &amp;&amp; zip project.zip project #scp上传</description>
</item>
<item>
<title>ant-design-landing生成页面报错</title>
<link>https://glitterlip.github.io/blog/2022-08/ant-design-landing%E7%94%9F%E6%88%90%E9%A1%B5%E9%9D%A2%E6%8A%A5%E9%94%99/</link>
<pubDate>Wed, 17 Aug 2022 01:49:05 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-08/ant-design-landing%E7%94%9F%E6%88%90%E9%A1%B5%E9%9D%A2%E6%8A%A5%E9%94%99/</guid>
<description>后台写完了要写个落地页,自己css太菜了,找个现成的吧. 发现这个项目挺好https://github.com/ant-design/ant-design-landing,相当于低代码吧。 编辑器 里面随便点点很快就能生成一个react页面,还可以直接整合到umijs项目里面. 和其他xx开源的项目一样,kpi产物不少,代码放出来就不维护了,在线demo体验很好,一放到本地跑起来就疯狂报错,这个项目也是年</description>
</item>
<item>
<title>umi4设置title keyword description</title>
<link>https://glitterlip.github.io/blog/2022-08/umi4%E8%AE%BE%E7%BD%AEtitle-keyword-description/</link>
<pubDate>Wed, 17 Aug 2022 01:49:05 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-08/umi4%E8%AE%BE%E7%BD%AEtitle-keyword-description/</guid>
<description>umijs升级到v4之后原来v3通过修改src/pages/document.ejs文件来设置title,keyword,description,favicon的方法 失效 了 新版本v4可以通过配置来修改 在config/config.ts中defineConfig方法添加字段 title: &#34;title&#34;, metas: [ { name: &#39;keywords&#39;, content: &#39;keywords&#39; }, { name: &#39;description&#39;, content: &#39;description&#39; }, ],</description>
</item>
<item>
<title>ant design pro datepicker</title>
<link>https://glitterlip.github.io/blog/2022-08/ant-design-pro-datepicker/</link>
<pubDate>Tue, 16 Aug 2022 18:54:24 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-08/ant-design-pro-datepicker/</guid>
<description>使用ant design pro的protable时,数据的字段是时间,筛选的时候想按照时间段来筛选 比如订单列表,支付时间字段的column列定义的valueType是dateTime,展示的时候展示成支付时间,但是在列表头筛选的时候按照支付时间段筛选 这个需求可以定义两个字段 { title: &#39;支付时间&#39;, dataIndex: &#39;paid_at&#39;, ellipsis: true, valueType: &#39;dateTime&#39;, hideInSearch: true }, { title: &#39;支付时间&#39;, dataIndex: &#39;paid_at&#39;, ellipsis: true, valueType: &#39;dateTimeRange&#39;, hideInTable: true, search: { transform: (value: any) =&gt; ({startTime: value[0], endTime: value[1]}), } }, 筛选查询的时</description>
</item>
<item>
<title>1480. Running Sum of 1d Array #</title>
<link>https://glitterlip.github.io/snippet/leetcode/1480/</link>
<pubDate>Wed, 10 Aug 2022 11:14:43 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/leetcode/1480/</guid>
<description>1480. Running Sum of 1d Array 题目 Given an array nums. We define a running sum of an array as runningSum[i] = sum(nums[0]…nums[i]). Return the running sum of nums. Example 1: Input: nums = [1,2,3,4] Output: [1,3,6,10] Explanation: Running sum is obtained as follows: [1, 1+2, 1+2+3, 1+2+3+4]. Example 2: Input: nums = [1,1,1,1,1] Output: [1,2,3,4,5] Explanation: Running sum is obtained as follows: [1, 1+1, 1+1+1, 1+1+1+1, 1+1+1+1+1]. Example 3: Input: nums = [3,1,2,10,1] Output: [3,4,6,16,17] Constraints: 1 &lt;= nums.length &lt;= 1000 -10^6 &lt;= nums[i] &lt;= 10^6 题目大意 给你一个数组 nums 。数组「动态和」的计算公式为:runningSum[i] = sum(nums[0]…nums[i]) 。请返回 nums 的动态和。 解题思路 简单题,按照题意依次循环计算前缀和即</description>
</item>
<item>
<title>ant design pro查看官网预览源码</title>
<link>https://glitterlip.github.io/snippet/ant-pro-preview/</link>
<pubDate>Wed, 10 Aug 2022 11:14:43 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/ant-pro-preview/</guid>
<description>emmm觉得官网的demo例子写的不错,想照着抄一下 克隆仓库git clone https://github.com/ant-design/ant-design-pro.git 进入项目目录yarn安装依赖 yarn run pro fetch-blocks --branch=v5获取代码块 yarn start就可以在本地跑起来demo了 config/routes.ts是路由文件,src/pages里面是源码</description>
</item>
<item>
<title>golang mysql设置时区</title>
<link>https://glitterlip.github.io/snippet/mysql-loc/</link>
<pubDate>Sat, 06 Aug 2022 11:14:43 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/mysql-loc/</guid>
<description>github.com/go-sql-driver包设置时区 DSN方式追加loc参数,值必须转义,/用%2F替换 DSN: parseTime=true&amp;loc=Asia%2FShanghai</description>
</item>
<item>
<title>laravel telescope get response code</title>
<link>https://glitterlip.github.io/snippet/telescope-response-code/</link>
<pubDate>Wed, 20 Jul 2022 09:53:11 +0800</pubDate>
<guid>https://glitterlip.github.io/snippet/telescope-response-code/</guid>
<description>Telescope::tag(function (IncomingEntry $entry) { $tags = []; if ( $entry-&gt;isRequest() ) { if ( $entry-&gt;content[&#39;response_status&#39;] == 302 ) { $tags[] = &#39;redirect&#39;; } } return $tags; }); </description>
</item>
<item>
<title>golang template函数传递多个参数</title>
<link>https://glitterlip.github.io/blog/2022-07/golang-template%E5%87%BD%E6%95%B0%E4%BC%A0%E9%80%92%E5%A4%9A%E4%B8%AA%E5%8F%82%E6%95%B0/</link>
<pubDate>Tue, 19 Jul 2022 09:53:11 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-07/golang-template%E5%87%BD%E6%95%B0%E4%BC%A0%E9%80%92%E5%A4%9A%E4%B8%AA%E5%8F%82%E6%95%B0/</guid>
<description>golang开发web页面时,会把页面的公共部分抽离出来,定义成组件 比如定义一个header,然后其他页面就无需再重复写了,直接引入即可 //header.html {{define &#34;header&#34;}} this is header. Current User:{{.user.Name}} {{end}} //detail.html {{template &#34;header&#34; .user}} 但是此时如果你想再展示天气,你可以定义一个UserWithWeather,这就有点不伦不类了 我们可以定义一个map模板函数 template.New(&#34;view&#34;).Funcs(template.FuncMap{ &#34;mapof&#34;: func(kvpairs ...interface{}) (map[string]interface{}, error) { if len(kvpairs)%2 != 0 { return nil, errors.New(&#34;wrong number of arguements&#34;) } dict := make(map[string]interface{}, len(kvpairs)/2) for i := 0; i &lt; len(kvpairs); i += 2 { key, ok := kvpairs[i].(string) if !ok { return nil, errors.New(&#34;map keys must be strings&#34;) } dict[key] = kvpairs[i+1] } return dict, nil }, })</description>
</item>
<item>
<title>支付宝免签付原理</title>
<link>https://glitterlip.github.io/blog/2022-07/%E6%94%AF%E4%BB%98%E5%AE%9D%E5%85%8D%E7%AD%BE%E4%BB%98%E5%8E%9F%E7%90%86/</link>
<pubDate>Mon, 18 Jul 2022 19:53:11 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-07/%E6%94%AF%E4%BB%98%E5%AE%9D%E5%85%8D%E7%AD%BE%E4%BB%98%E5%8E%9F%E7%90%86/</guid>
<description>支付宝网站接入支付需要营业执照,ICP备案。 可以在百度或者高德随便找个门头照申请开通当面付,0.38的费率,单笔交易限额1000,日限额5w。不过如果频繁有外地ip支付就会风控,包括要求提供营业执照,限制收款,以及清退,最严重的就是当面抓了^ - ^。 这个时候可以用收款码(码支付)解决。 主要原理就是系统生成固定金额的支付宝个人收款码,展示给用户,用户付款,手机收到转账到帐通知后通知网站支付成功。 示例代</description>
</item>
<item>
<title>golang cron包计划任务不执行</title>
<link>https://glitterlip.github.io/blog/2022-07/golang-cron%E5%8C%85%E8%AE%A1%E5%88%92%E4%BB%BB%E5%8A%A1%E4%B8%8D%E6%89%A7%E8%A1%8C/</link>
<pubDate>Mon, 18 Jul 2022 09:53:11 +0800</pubDate>
<guid>https://glitterlip.github.io/blog/2022-07/golang-cron%E5%8C%85%E8%AE%A1%E5%88%92%E4%BB%BB%E5%8A%A1%E4%B8%8D%E6%89%A7%E8%A1%8C/</guid>
<description>cron包旧版本中的表达式和常见的linux crontab表达式并不一致, 多了一个秒级别的定时,新版本中v3已经移除了 如果你在使用github.com/robfig/cron/v3这个包的时候遇到计划任务未执行可能是这个原因 使用秒级定时器 c:=cron.New(cron.WithSeconds()) c.AddFunc(&#34;0 30 * * * *&#34;, func() { fmt.Println(&#34;Every hour on the half hour&#34;) }) 不需要秒级定时器 c:=cron.New() c.AddFunc(&#34;30 * * * *&#34;, func() { fmt.Println(&#34;Every hour on the half hour&#34;) })</description>
</item>
</channel>
</rss>