-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathatom.xml
521 lines (305 loc) · 41.3 KB
/
atom.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
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>前端路上</title>
<icon>https://blog.imx0.com/icon.png</icon>
<subtitle>万物皆有裂缝</subtitle>
<link href="https://blog.imx0.com/atom.xml" rel="self"/>
<link href="https://blog.imx0.com/"/>
<updated>2024-05-26T07:38:02.000Z</updated>
<id>https://blog.imx0.com/</id>
<author>
<name>2ue</name>
</author>
<generator uri="https://hexo.io/">Hexo</generator>
<entry>
<title>Node.js开发必看系列之-如何在ES模块中正确使用__dirname和__filename</title>
<link href="https://blog.imx0.com/2024-05-26/Node.js%E5%BC%80%E5%8F%91%E5%BF%85%E7%9C%8B%E7%B3%BB%E5%88%97%E4%B9%8B-%E5%A6%82%E4%BD%95%E5%9C%A8ES%E6%A8%A1%E5%9D%97%E4%B8%AD%E6%AD%A3%E7%A1%AE%E4%BD%BF%E7%94%A8__dirname%E5%92%8C__filename.html"/>
<id>https://blog.imx0.com/2024-05-26/Node.js%E5%BC%80%E5%8F%91%E5%BF%85%E7%9C%8B%E7%B3%BB%E5%88%97%E4%B9%8B-%E5%A6%82%E4%BD%95%E5%9C%A8ES%E6%A8%A1%E5%9D%97%E4%B8%AD%E6%AD%A3%E7%A1%AE%E4%BD%BF%E7%94%A8__dirname%E5%92%8C__filename.html</id>
<published>2024-05-26T07:38:02.000Z</published>
<updated>2024-05-26T07:38:02.000Z</updated>
<summary type="html"><h2 id="引言"><a href="#引言" class="headerlink" title="引言"></a>引言</h2><p>在Node.js中,<code>__dirname</code>是一个非常有用的全局变量,它返回当前正在执行的脚本所在的目录名。然而,随着Node.js对ES模块(ESM)的支持,直接在ES模块中使用<code>__dirname</code>会导致“<code>__dirname is not defined in ES module scope</code>”的错误信息。本文将探讨这一问题,并提供有效的解决方案。</p>
<h2 id="理解ES模块与CommonJS"><a href="#理解ES模块与CommonJS" class="headerlink" title="理解ES模块与CommonJS"></a>理解ES模块与CommonJS</h2></summary>
<category term="前端/Nodejs" scheme="https://blog.imx0.com/categories/%E5%89%8D%E7%AB%AF-Nodejs/"/>
<category term="Nodejs" scheme="https://blog.imx0.com/tags/Nodejs/"/>
<category term="__dirname" scheme="https://blog.imx0.com/tags/dirname/"/>
<category term="__filename" scheme="https://blog.imx0.com/tags/filename/"/>
</entry>
<entry>
<title>Oh My Zsh 自动化:轻松管理多个 Git 用户身份信息</title>
<link href="https://blog.imx0.com/2024-04-23/Oh%20My%20Zsh%20%E8%87%AA%E5%8A%A8%E5%8C%96-%E8%BD%BB%E6%9D%BE%E7%AE%A1%E7%90%86%E5%A4%9A%E4%B8%AA%20Git%20%E7%94%A8%E6%88%B7%E8%BA%AB%E4%BB%BD%E4%BF%A1%E6%81%AF.html"/>
<id>https://blog.imx0.com/2024-04-23/Oh%20My%20Zsh%20%E8%87%AA%E5%8A%A8%E5%8C%96-%E8%BD%BB%E6%9D%BE%E7%AE%A1%E7%90%86%E5%A4%9A%E4%B8%AA%20Git%20%E7%94%A8%E6%88%B7%E8%BA%AB%E4%BB%BD%E4%BF%A1%E6%81%AF.html</id>
<published>2024-04-23T06:05:00.000Z</published>
<updated>2024-04-23T06:05:00.000Z</updated>
<summary type="html"><blockquote>
<p>在 Git 工作流中,有时需要在同一台电脑上针对不同的项目设置不同的用户身份。例如,开发人员可能需要在个人项目和公司项目之间切换,而这两个项目可能需要不同的 Git 用户名和电子邮件地址。Oh My Zsh 提供了强大的自定义功能,允许我们通过编写自定义的 shell 函数来实现这一需求。本文将展示如何使用 Oh My Zsh 的 <code>chpwd</code> 函数来自动设置特定目录及其子目录、孙目录下的 Git 用户配置。</p>
</blockquote>
<h2 id="开始之前"><a href="#开始之前" class="headerlink" title="开始之前"></a>开始之前</h2><p>假设你对git身份信息和ssh key概念有比较清晰的认识和了解其基础使用,比如git身份信息是用户名和邮箱,在你使用git commit的时候进行记录;而ssh key是一个凭证(分为公钥和私钥),用于远端身份信息验证,和git没有直接关系,也可以用于其他场景使用,比如ssh登录远程主机。</p></summary>
<category term="git" scheme="https://blog.imx0.com/categories/git/"/>
<category term="oh-my-zsh" scheme="https://blog.imx0.com/categories/git/oh-my-zsh/"/>
<category term="git" scheme="https://blog.imx0.com/tags/git/"/>
<category term="oh-my-zsh" scheme="https://blog.imx0.com/tags/oh-my-zsh/"/>
<category term="git多身份" scheme="https://blog.imx0.com/tags/git%E5%A4%9A%E8%BA%AB%E4%BB%BD/"/>
</entry>
<entry>
<title>使用Github Action自动化发布npm包</title>
<link href="https://blog.imx0.com/2024-04-20/%E4%BD%BF%E7%94%A8Github%20Action%E8%87%AA%E5%8A%A8%E5%8C%96%E5%8F%91%E5%B8%83npm%E5%8C%85.html"/>
<id>https://blog.imx0.com/2024-04-20/%E4%BD%BF%E7%94%A8Github%20Action%E8%87%AA%E5%8A%A8%E5%8C%96%E5%8F%91%E5%B8%83npm%E5%8C%85.html</id>
<published>2024-04-20T08:32:00.000Z</published>
<updated>2024-04-20T08:32:00.000Z</updated>
<summary type="html"><blockquote>
<p>GitHub Actions 提供了一种强大的自动化构建和发布流程的方式,通过组合github action的方式形成了workflow,来实现CI&#x2F;CD。我们完全可以将 npm 包的发布流程集成到 GitHub workflow中,做到自动化发包,这可以可以提高效率并减少人为错误。以下是如何使用 GitHub Actions 实现自动化发布的详细指南。</p>
</blockquote>
<h2 id="0-原理解释"><a href="#0-原理解释" class="headerlink" title="0. 原理解释"></a>0. 原理解释</h2><p>github actions是一个github推出的CI&#x2F;CD工具,可以模拟平台(比如linux等)自动化执行一些操作。<br>npm可以通过token实现免登陆发布包,并且Github Secrets能很好的保护token不被泄露(后面会说简单说一下为什么),这样就避免了在登陆信息在CI&#x2F;CD时泄露</p></summary>
<category term="github/actions" scheme="https://blog.imx0.com/categories/github-actions/"/>
<category term="npm" scheme="https://blog.imx0.com/tags/npm/"/>
<category term="CD" scheme="https://blog.imx0.com/tags/CD/"/>
<category term="CI" scheme="https://blog.imx0.com/tags/CI/"/>
<category term="action" scheme="https://blog.imx0.com/tags/action/"/>
<category term="github" scheme="https://blog.imx0.com/tags/github/"/>
</entry>
<entry>
<title>如何使用Github Actions实现自动化部署Hexo博客</title>
<link href="https://blog.imx0.com/2024-04-19/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8Github%20Actions%E5%AE%9E%E7%8E%B0%E8%87%AA%E5%8A%A8%E5%8C%96%E9%83%A8%E7%BD%B2Hexo%E5%8D%9A%E5%AE%A2.html"/>
<id>https://blog.imx0.com/2024-04-19/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8Github%20Actions%E5%AE%9E%E7%8E%B0%E8%87%AA%E5%8A%A8%E5%8C%96%E9%83%A8%E7%BD%B2Hexo%E5%8D%9A%E5%AE%A2.html</id>
<published>2024-04-19T06:01:02.000Z</published>
<updated>2024-04-19T06:01:02.000Z</updated>
<summary type="html"><blockquote>
<p>Hexo 是一个基于 Node.js 的静态博客框架,它以简洁的速度和易用性受到许多开发者的青睐。如果你的博客部署在github上,那么这里有一种新的部署方式可能让摆脱频繁提交部署的苦恼!GitHub Actions 为自动化部署Hexo提供了一种解决方案,极大地简化了部署流程和节省了时间,可以让我们更多的专注到写作本身。</p>
</blockquote>
<h2 id="为什么使用Github-Actions"><a href="#为什么使用Github-Actions" class="headerlink" title="为什么使用Github Actions"></a>为什么使用Github Actions</h2><ul>
<li>将文章源文件和部署文件分离,有助于保护源文件中的隐私和你的草稿文件等</li>
<li>节省手动部署的时间,专注于写作本身</li>
<li>学习Github Actions相关知识,不折腾不作死发作了</li>
</ul></summary>
<category term="hexo" scheme="https://blog.imx0.com/categories/hexo/"/>
<category term="github" scheme="https://blog.imx0.com/categories/hexo/github/"/>
<category term="action" scheme="https://blog.imx0.com/tags/action/"/>
<category term="github" scheme="https://blog.imx0.com/tags/github/"/>
<category term="hexo" scheme="https://blog.imx0.com/tags/hexo/"/>
</entry>
<entry>
<title>使用conda快速初始化项目python</title>
<link href="https://blog.imx0.com/2024-03-07/%E4%BD%BF%E7%94%A8conda%E5%BF%AB%E9%80%9F%E5%88%9D%E5%A7%8B%E5%8C%96%E9%A1%B9%E7%9B%AEpython.html"/>
<id>https://blog.imx0.com/2024-03-07/%E4%BD%BF%E7%94%A8conda%E5%BF%AB%E9%80%9F%E5%88%9D%E5%A7%8B%E5%8C%96%E9%A1%B9%E7%9B%AEpython.html</id>
<published>2024-03-07T05:15:00.000Z</published>
<updated>2024-03-07T05:15:00.000Z</updated>
<summary type="html"><blockquote>
<p>python的环境管理方案很多,社区有很多解决方案,本文介绍一种常用的、支持多版本python、多人协作的、方便快捷的环境管理方案:<a href="%5B%60miniforge%60%5D(https://github.com/conda-forge/miniforge)">miniforge-conda</a></p>
</blockquote>
<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>进行项目的依赖管理,最根本的情况有以下几种:</p></summary>
<category term="python/miniforge" scheme="https://blog.imx0.com/categories/python-miniforge/"/>
<category term="python" scheme="https://blog.imx0.com/tags/python/"/>
<category term="Anaconda" scheme="https://blog.imx0.com/tags/Anaconda/"/>
<category term="conda" scheme="https://blog.imx0.com/tags/conda/"/>
<category term="miniforge" scheme="https://blog.imx0.com/tags/miniforge/"/>
</entry>
<entry>
<title>Mac提示”xxx.app已损坏,无法打开,你应该将它移到废纸篓”的解决方法</title>
<link href="https://blog.imx0.com/2021-09-14/Mac%E6%8F%90%E7%A4%BA%E2%80%9Dxxx.app%E5%B7%B2%E6%8D%9F%E5%9D%8F%EF%BC%8C%E6%97%A0%E6%B3%95%E6%89%93%E5%BC%80%EF%BC%8C%E4%BD%A0%E5%BA%94%E8%AF%A5%E5%B0%86%E5%AE%83%E7%A7%BB%E5%88%B0%E5%BA%9F%E7%BA%B8%E7%AF%93%E2%80%9D%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html"/>
<id>https://blog.imx0.com/2021-09-14/Mac%E6%8F%90%E7%A4%BA%E2%80%9Dxxx.app%E5%B7%B2%E6%8D%9F%E5%9D%8F%EF%BC%8C%E6%97%A0%E6%B3%95%E6%89%93%E5%BC%80%EF%BC%8C%E4%BD%A0%E5%BA%94%E8%AF%A5%E5%B0%86%E5%AE%83%E7%A7%BB%E5%88%B0%E5%BA%9F%E7%BA%B8%E7%AF%93%E2%80%9D%E7%9A%84%E8%A7%A3%E5%86%B3%E6%96%B9%E6%B3%95.html</id>
<published>2021-09-14T11:50:48.000Z</published>
<updated>2021-09-14T11:50:48.000Z</updated>
<summary type="html"><p>随着mac系统的升级,对app安全控制越来越严,经常遇到一些非官方渠道安装的app,安装后无法打开的情况,如提示”xxx.app已损坏,无法打开,你应该将它移到废纸篓”,一般情况下,出现该问题是因为软件没有签名,所以被MAC系统禁止运行。可以尝试以下解决方案</p>
<h2 id="老系统:设置允许任何来源下载的App"><a href="#老系统:设置允许任何来源下载的App" class="headerlink" title="老系统:设置允许任何来源下载的App"></a>老系统:设置允许任何来源下载的App</h2><p>比较老的版本系统,可以按以下步骤操作:<br>打开”系统偏好设置 -&gt; 安全与隐私 -&gt; 通用”选项卡,检查是否已经启用了”任何来源”选项。如果没有启用,先点击左下角的小黄锁图标解锁,然后选中”任何来源”。(由于作者mac系统比较新,故此图来源网络)<br><img data-src="https://raw.githubusercontent.com/2ue/post-files/main/files/20240424125739-50d88ba9028afaa7fbbfd06d2ff6c107-1713934660.png" alt="image.png"></p></summary>
<category term="mac" scheme="https://blog.imx0.com/categories/mac/"/>
<category term="mac" scheme="https://blog.imx0.com/tags/mac/"/>
<category term="app损坏" scheme="https://blog.imx0.com/tags/app%E6%8D%9F%E5%9D%8F/"/>
</entry>
<entry>
<title>ubuntu云服务器安装docker及docker-compose保姆级教程</title>
<link href="https://blog.imx0.com/2021-07-03/ubuntu%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E8%A3%85docker%E5%8F%8Adocker-compose%E4%BF%9D%E5%A7%86%E7%BA%A7%E6%95%99%E7%A8%8B.html"/>
<id>https://blog.imx0.com/2021-07-03/ubuntu%E4%BA%91%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%AE%89%E8%A3%85docker%E5%8F%8Adocker-compose%E4%BF%9D%E5%A7%86%E7%BA%A7%E6%95%99%E7%A8%8B.html</id>
<published>2021-07-03T12:55:52.000Z</published>
<updated>2024-05-03T15:03:30.000Z</updated>
<summary type="html"><blockquote>
<p>本文记录在ubuntu云服务器上安装docker和docker-compose的完整过程及踩坑</p>
</blockquote>
<p>为什么安装docker时会卡在添加秘钥这一步?<br>为什么安装docker-compose时,下载总是失败?<br>为什么安装的docker-compose不是最新版本?<br>…<br>且看下文,帮你解惑~</p>
<h2 id="卸载旧版本"><a href="#卸载旧版本" class="headerlink" title="卸载旧版本"></a>卸载旧版本</h2></summary>
<category term="安装教程" scheme="https://blog.imx0.com/categories/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/"/>
<category term="docker" scheme="https://blog.imx0.com/tags/docker/"/>
<category term="ubuntu" scheme="https://blog.imx0.com/tags/ubuntu/"/>
<category term="docker-compose" scheme="https://blog.imx0.com/tags/docker-compose/"/>
</entry>
<entry>
<title>使用Npm Token免登陆发包</title>
<link href="https://blog.imx0.com/2019-10-12/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8Npm%20Token%E5%85%8D%E7%99%BB%E9%99%86%E5%8F%91%E5%8C%85.html"/>
<id>https://blog.imx0.com/2019-10-12/%E5%A6%82%E4%BD%95%E4%BD%BF%E7%94%A8Npm%20Token%E5%85%8D%E7%99%BB%E9%99%86%E5%8F%91%E5%8C%85.html</id>
<published>2019-10-12T06:01:24.000Z</published>
<updated>2024-04-13T09:51:31.000Z</updated>
<summary type="html"><blockquote>
<p>在使用 npm 包管理器进行包的发布时,通常需要手动登录 npm 账户,并且我们在本地使用npm时因为某些不可抗原因,使用了非npm官方源,导致我们每次发布都需要切换到官方源,显得非常繁琐。现在,通过使用 npm Token,可以避免手动登录,切换源等步骤,实现自动化发布流程,特别是在持续集成&#x2F;持续部署(CI&#x2F;CD)环境中。</p>
</blockquote>
<h2 id="1-准备工作"><a href="#1-准备工作" class="headerlink" title="1. 准备工作"></a>1. 准备工作</h2><p>在开始之前,请确保:</p></summary>
<category term="npm" scheme="https://blog.imx0.com/categories/npm/"/>
<category term="npm" scheme="https://blog.imx0.com/tags/npm/"/>
</entry>
<entry>
<title>如何解决“cannot remove directory not empty”</title>
<link href="https://blog.imx0.com/2019-05-29/how%20to%20solve%20cannot%20remove%20directory%20not%20empty.html"/>
<id>https://blog.imx0.com/2019-05-29/how%20to%20solve%20cannot%20remove%20directory%20not%20empty.html</id>
<published>2019-05-29T09:43:30.000Z</published>
<updated>2019-05-29T09:43:30.000Z</updated>
<summary type="html"><blockquote>
<p>在windows系统下,删除文件或者文件夹,出现”Cannot remove xxx: Directory not empty”,如果在使用各种删除方法(比如使用命令行删除,解除占用,kill相关进程等)都得到相同的提示后,那么一般是磁盘存在问题,可以尝试使用<code>CHKDSK</code>命令来修复磁盘解决问题</p>
</blockquote>
<h2 id="CHKDSK"><a href="#CHKDSK" class="headerlink" title="CHKDSK"></a>CHKDSK</h2><p><code>CHKDSK</code>的全称是check disk,就是磁盘检查的意思。该工具基于被检测的分区所用的<span class="exturl" data-url="aHR0cHM6Ly9iYWlrZS5iYWlkdS5jb20vaXRlbS8lRTYlOTYlODclRTQlQkIlQjYlRTclQjMlQkIlRTclQkIlOUYvNDgyNzIxNT9mcm9tTW9kdWxlPWxlbW1hX2lubGluaw==">文件系统<i class="fa fa-external-link-alt"></i></span>,可以检查硬盘文件系统的完整性,并可以修复FAT16、FAT32和NTFS硬盘上的各种文件系统错误,创建和显示磁盘的状态报告。CHKDSK 还会列出并纠正磁盘上的错误。</p></summary>
<category term="/" scheme="https://blog.imx0.com/categories/"/>
<category term="Windows" scheme="https://blog.imx0.com/tags/Windows/"/>
</entry>
<entry>
<title>Node.js版本神器之nvm</title>
<link href="https://blog.imx0.com/2018-07-21/node.js-version-management-artifact-nvm.html"/>
<id>https://blog.imx0.com/2018-07-21/node.js-version-management-artifact-nvm.html</id>
<published>2018-07-21T11:47:23.000Z</published>
<updated>2018-07-21T11:47:23.000Z</updated>
<summary type="html"><h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>Node Version Manager (nvm) 是一个易于使用的工具,可以帮助您在不同Node.js版本之间进行切换,以满足不同项目的需求。</p>
<h2 id="背景"><a href="#背景" class="headerlink" title="背景"></a>背景</h2></summary>
<category term="工具" scheme="https://blog.imx0.com/categories/%E5%B7%A5%E5%85%B7/"/>
<category term="nvm" scheme="https://blog.imx0.com/categories/%E5%B7%A5%E5%85%B7/nvm/"/>
<category term="node" scheme="https://blog.imx0.com/tags/node/"/>
<category term="npm" scheme="https://blog.imx0.com/tags/npm/"/>
<category term="nvm" scheme="https://blog.imx0.com/tags/nvm/"/>
<category term="版本管理" scheme="https://blog.imx0.com/tags/%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86/"/>
</entry>
<entry>
<title>Git系列之SSH Key配置</title>
<link href="https://blog.imx0.com/2018-03-08/Git%E7%B3%BB%E5%88%97%E4%B9%8BSSH%20Key%E9%85%8D%E7%BD%AE.html"/>
<id>https://blog.imx0.com/2018-03-08/Git%E7%B3%BB%E5%88%97%E4%B9%8BSSH%20Key%E9%85%8D%E7%BD%AE.html</id>
<published>2018-03-08T10:03:07.000Z</published>
<updated>2018-03-08T10:03:07.000Z</updated>
<summary type="html"><blockquote>
<p>在使用Git进行版本控制时,SSH密钥是一种常见的身份验证方式。当你需要在同一台机器上管理多个Git账户时,如何配置和使用多个SSH密钥呢?本文将为你提供一份的教程</p>
</blockquote>
<h2 id="说明"><a href="#说明" class="headerlink" title="说明"></a>说明</h2><p>本篇文章以github仓库为例来进行说明</p></summary>
<category term="工具/git" scheme="https://blog.imx0.com/categories/%E5%B7%A5%E5%85%B7-git/"/>
<category term="git" scheme="https://blog.imx0.com/tags/git/"/>
<category term="ssh" scheme="https://blog.imx0.com/tags/ssh/"/>
<category term="ssh-key" scheme="https://blog.imx0.com/tags/ssh-key/"/>
</entry>
<entry>
<title>Git系列常用命令之放弃修改</title>
<link href="https://blog.imx0.com/2018-01-20/Git%E7%B3%BB%E5%88%97%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E4%B9%8B%E6%94%BE%E5%BC%83%E4%BF%AE%E6%94%B9.html"/>
<id>https://blog.imx0.com/2018-01-20/Git%E7%B3%BB%E5%88%97%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E4%B9%8B%E6%94%BE%E5%BC%83%E4%BF%AE%E6%94%B9.html</id>
<published>2018-01-20T11:52:00.000Z</published>
<updated>2018-05-03T06:50:00.000Z</updated>
<summary type="html"><blockquote>
<p>Git 是一种流行的分布式版本控制系统,它允许开发者在不同的分支上进行工作,同时保持代码的完整性和历史记录。在使用 Git 进行版本控制的过程中,我们可能会遇到需要放弃当前工作进度的情况,例如,当发现当前分支的修改与主分支的代码不兼容,或者需要切换到另一个分支继续工作时。</p>
</blockquote>
<h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><p>这篇文章会介绍如何在 Git 中放弃对文件的修改,包括以下几个方面:</p></summary>
<category term="工具/git" scheme="https://blog.imx0.com/categories/%E5%B7%A5%E5%85%B7-git/"/>
<category term="git" scheme="https://blog.imx0.com/tags/git/"/>
</entry>
<entry>
<title>风继续吹</title>
<link href="https://blog.imx0.com/2017-11-29/blow-forever.html"/>
<id>https://blog.imx0.com/2017-11-29/blow-forever.html</id>
<published>2017-11-29T14:53:37.000Z</published>
<updated>2017-11-29T14:53:37.000Z</updated>
<summary type="html"><blockquote>
<p>最近在某些比较看重的事情上,处理的很失败,感觉整个心态都发生了变化。下班独行的那段路上,突然惊醒自己也许需要做出一些改变,晚饭后静静的思考了一阵:似乎勇往前行才是我最需需要的改变。古语有云:走自己的路,让别人去说吧。是的,生活需要你不断踽踽独行,活在他人的世界里是可怕的,特别他(她)还是陌生人。随手记录一些句子,它们是我最近的心态和生活的写照,也以此鞭策自己砥砺前行。</p>
</blockquote>
<hr>
<p>时间不会因你沮丧而停滞不前<br>生活不会因你懊恼而雨过天晴</p></summary>
<category term="随想" scheme="https://blog.imx0.com/categories/%E9%9A%8F%E6%83%B3/"/>
<category term="人生" scheme="https://blog.imx0.com/tags/%E4%BA%BA%E7%94%9F/"/>
</entry>
<entry>
<title>常用javascript代码片段</title>
<link href="https://blog.imx0.com/2017-11-26/javascript-sinpats.html"/>
<id>https://blog.imx0.com/2017-11-26/javascript-sinpats.html</id>
<published>2017-11-26T14:37:45.000Z</published>
<updated>2017-11-26T14:37:45.000Z</updated>
<summary type="html"><blockquote>
<p>下面记录的主要是本人在项目中遇到的一些问题的解决方案或者个人觉得精妙的代码,方案也许来自于自己的想法,也有可能来自于网络(我尽量给出出处,以便大家追源溯流),也许干脆就是一个插件库(实际在项目中对于一些小的功能个人是拒绝引入不纯粹的三方库的)。肯定,这其中有些方案也不是尽善尽美,我会一一列出。如果对于某个问题在你看来有更好的解决方案,请不吝指出!</p>
</blockquote>
<h2 id="placeholder属性支持"><a href="#placeholder属性支持" class="headerlink" title="placeholder属性支持"></a>placeholder属性支持</h2><p>有时候项目中placeholder也许要兼容某些特殊的浏览器,所以才有了下面这段代码。这种方案有一个缺点就是:如果你恰好要对这个输入框绑定focus事件并操作它的值,必须要小心处理</p></summary>
<category term="javascript" scheme="https://blog.imx0.com/categories/javascript/"/>
<category term="sinpats" scheme="https://blog.imx0.com/tags/sinpats/"/>
</entry>
<entry>
<title>一道小小的题目引发对javascript支持正则表达式相关方法的探讨</title>
<link href="https://blog.imx0.com/2017-11-24/regex-to-something.html"/>
<id>https://blog.imx0.com/2017-11-24/regex-to-something.html</id>
<published>2017-11-24T01:57:10.000Z</published>
<updated>2017-11-24T01:57:10.000Z</updated>
<summary type="html"><blockquote>
<p>以前对于正则是非常惧怕的,因为看不懂和学不会。但最近项目中频繁的使用到了正则,因此强迫自己去学习了解,慢慢的体会到了他的魅力与强大。当然学习正则初入门的时候有些枯燥难懂,但越学越觉得轻松。本文不准备说关于正则本身的事儿,而是说一说关于javascript中关于正则的几个方法中被很多人忽略的地方。</p>
</blockquote>
<h2 id="工具"><a href="#工具" class="headerlink" title="工具"></a>工具</h2><p>说到正则,很多人都是从抄到改到自己写,这个过程可能有时候很漫长。如一些工具能帮助你快速分析和学习正则,那么学习的过程你肯定要轻松得多。下面我推荐两个我经常使用的正则在线可视化工具,正则可视化工具图解符合铁路图规律(其实不明白什么是铁路一样很容易看懂,只是一些细微的地方和我们的常规思维有点差别)。</p></summary>
<category term="regex" scheme="https://blog.imx0.com/categories/regex/"/>
<category term="javascript" scheme="https://blog.imx0.com/tags/javascript/"/>
<category term="regex" scheme="https://blog.imx0.com/tags/regex/"/>
</entry>
<entry>
<title>vue中慎用style的scoped属性</title>
<link href="https://blog.imx0.com/2017-11-15/vue-style-scoped.html"/>
<id>https://blog.imx0.com/2017-11-15/vue-style-scoped.html</id>
<published>2017-11-15T11:09:16.000Z</published>
<updated>2017-11-15T11:09:16.000Z</updated>
<summary type="html"><blockquote>
<p>在vue组件中,在style标签上添加scoped属性,以表示它的样式作用于当下的模块,很好的实现了样式私有化的目的,这是一个非常好的机制。但是为什么要慎用呢?在实际业务中我们往往会对公共组件样式做细微的调整,如果添加了scoped属性,那么样式将会变得不易修改。初写这篇文章时,本人没有找到一个好的方法去解决这个问题,后来经过大伙的解答,才让我恍然大悟。</p>
</blockquote>
<h2 id="何为谨慎使用"><a href="#何为谨慎使用" class="headerlink" title="何为谨慎使用"></a>何为谨慎使用</h2><p>谨慎使用不是不用,而是持一种审视的目光去看待它。<code>scoped</code>肯定是解决了样式私有化的问题,但同时也引入了新的问题—样式不易(可)修改,而很多时候,我们是需要对公共组件的样式做微调的。所以我才说要谨慎使用</p></summary>
<category term="vue" scheme="https://blog.imx0.com/categories/vue/"/>
<category term="javascript" scheme="https://blog.imx0.com/tags/javascript/"/>
<category term="vue" scheme="https://blog.imx0.com/tags/vue/"/>
</entry>
<entry>
<title>如何写一个日历组件</title>
<link href="https://blog.imx0.com/2017-11-02/how-to-make-a-kalendar.html"/>
<id>https://blog.imx0.com/2017-11-02/how-to-make-a-kalendar.html</id>
<published>2017-11-02T02:08:43.000Z</published>
<updated>2017-11-02T02:08:43.000Z</updated>
<summary type="html"><blockquote>
<p>众所周知,虽然<code>javascript</code>中关于时间的API有不少,我们可以通过方法单独的获取年、月、日、时、分、秒、毫秒…貌似很多,最近写了一个日历(以前写的,但写得很烂,最近优化一下),所以下面简单的记录一下如何写一个日历,列出了一些我在写日历过程中自己封装的一些方法</p>
</blockquote>
<h2 id="效果图"><a href="#效果图" class="headerlink" title="效果图"></a>效果图</h2><p>先来一张效果图,由于没有UI设计,所以就自己简单的设计了一个样式(好歹我也是设计专业的,虽然已不做设计很多年),虽然略丑,但重要的是功能!!!</p></summary>
<category term="javascript" scheme="https://blog.imx0.com/categories/javascript/"/>
<category term="日历" scheme="https://blog.imx0.com/tags/%E6%97%A5%E5%8E%86/"/>
<category term="kalendar" scheme="https://blog.imx0.com/tags/kalendar/"/>
</entry>
<entry>
<title>慎重用for...in与for...of</title>
<link href="https://blog.imx0.com/2017-10-27/for-in-and-for-of.html"/>
<id>https://blog.imx0.com/2017-10-27/for-in-and-for-of.html</id>
<published>2017-10-27T06:43:12.000Z</published>
<updated>2017-10-27T06:43:12.000Z</updated>
<summary type="html"><blockquote>
<p><code>for...in</code>和<code>for...of</code>都是用于数据的遍历。<code>for...in</code>是<code>ES5</code>标准,用于遍历对象属性(键),而<code>for...of</code>是<code>ES6</code>标准,是对<code>for...in</code>的修正,用于遍历对象元素(值),<code>for...of</code>兼容性不是很好(除了PC端老顽固<code>IE</code>之外,移动端某些安卓机和浏览器也是不支持它,具体可以<span class="exturl" data-url="aHR0cHM6Ly9kZXZlbG9wZXIubW96aWxsYS5vcmcvemgtQ04vZG9jcy9XZWIvSmF2YVNjcmlwdC9SZWZlcmVuY2UvU3RhdGVtZW50cy9mb3IuLi5vZg==">查看MDN<i class="fa fa-external-link-alt"></i></span>)。</p>
</blockquote>
<h2 id="for…in"><a href="#for…in" class="headerlink" title="for…in"></a>for…in</h2><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="title class_">Object</span>.<span class="property"><span class="keyword">prototype</span></span>.<span class="property">objMethod</span> = <span class="keyword">function</span>(<span class="params"></span>) &#123;&#125;;</span><br><span class="line"><span class="title class_">Array</span>.<span class="property"><span class="keyword">prototype</span></span>.<span class="property">arrMethod</span> = <span class="keyword">function</span>(<span class="params"></span>) &#123;&#125;;</span><br><span class="line"></span><br><span class="line"><span class="keyword">var</span> arr = [<span class="number">2</span>, <span class="number">9</span>, <span class="number">5</span>], obj = &#123; <span class="attr">name</span>: <span class="string">&#x27;2ue&#x27;</span>, <span class="attr">w</span>: <span class="number">130</span> &#125;;</span><br><span class="line">arr.<span class="property">msg</span> = <span class="string">&#x27;hello&#x27;</span>;</span><br><span class="line">obj.<span class="property">msg</span> = <span class="string">&#x27;hello&#x27;</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">var</span> i <span class="keyword">in</span> arr) &#123;</span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(i); <span class="comment">// &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;msg&quot;, &quot;arrCustom&quot;, &quot;objCustom&quot;</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">var</span> i <span class="keyword">in</span> arr) &#123;</span><br><span class="line"> <span class="keyword">if</span> (arr.<span class="title function_">hasOwnProperty</span>(i)) &#123;</span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(i); <span class="comment">// &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;msg&quot;</span></span><br><span class="line"> &#125;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">var</span> i <span class="keyword">in</span> obj) &#123;</span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(i); <span class="comment">// &quot;name&quot;, &quot;w&quot;, &quot;msg&quot;, &quot;objCustom&quot;</span></span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">var</span> i <span class="keyword">in</span> obj) &#123;</span><br><span class="line"> <span class="keyword">if</span> (obj.<span class="title function_">hasOwnProperty</span>(i)) &#123;</span><br><span class="line"> <span class="variable language_">console</span>.<span class="title function_">log</span>(i); <span class="comment">// &quot;name&quot;, &quot;w&quot;, &quot;msg&quot;</span></span><br><span class="line"> &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></summary>
<category term="javascript" scheme="https://blog.imx0.com/categories/javascript/"/>
<category term="遍历" scheme="https://blog.imx0.com/tags/%E9%81%8D%E5%8E%86/"/>
<category term="for...in" scheme="https://blog.imx0.com/tags/for-in/"/>
<category term="for...of" scheme="https://blog.imx0.com/tags/for-of/"/>
</entry>
<entry>
<title>H5的Notification特性 - Web的桌面通知功能</title>
<link href="https://blog.imx0.com/2017-10-16/desktop-notification.html"/>
<id>https://blog.imx0.com/2017-10-16/desktop-notification.html</id>
<published>2017-10-16T02:16:37.000Z</published>
<updated>2017-10-16T02:16:37.000Z</updated>
<summary type="html"><blockquote>
<p>目前,<code>web</code>网页使用桌面通知功能的越来越多,包括微博,腾讯视频等大厂站,桌面通知功能是<code>H5</code>的一个<code>API</code> - <code>Notifications</code>。它允许网页或应用程序可以发出通知,通知将被显示在页面之外的[[系统]]层面上(通常使用操作[[系统]]的标准通知机制,但是在不同的平台和浏览器上的表现会有差异),这样即使应用程序空闲或在后台也可以向用户发送信息。</p>
</blockquote>
<h2 id="应用场景"><a href="#应用场景" class="headerlink" title="应用场景"></a>应用场景</h2><p><code>Notifications</code>的诞生简化了网站或者应用与用户之间的沟通成本(时间成本和开发成本),增强用户黏性(减少了用户离开应用的可能)。传统的通知方式,大多是通过站内信(消息),邮件,短信等方式,它们通常需要刷新(跳转)页面、离开应用打开其他应用或终端来查看消息;而桌面通知功能大大的简化了这个过程,消息的传递基本不消耗时间(如果不设置<code>setTimeout</code>,用时基本不会超过<code>1s</code>),并且用户不需要离开应用,这都带来了极大的方便。可以预见,<code>Notifications</code>将会在很多网页或应用中被大量使用。当然<code>Notifications</code>也具有它的局限性:无法存档、即看即毁<br>那么,这个功能到底能用在哪些场景呢?只能说能应用的场景很多:</p></summary>
<category term="H5" scheme="https://blog.imx0.com/categories/H5/"/>
<category term="Notification" scheme="https://blog.imx0.com/tags/Notification/"/>
<category term="javascript" scheme="https://blog.imx0.com/tags/javascript/"/>
</entry>
<entry>
<title>mocha+chai使用记录</title>
<link href="https://blog.imx0.com/2017-10-10/mocha+chai.html"/>
<id>https://blog.imx0.com/2017-10-10/mocha+chai.html</id>
<published>2017-10-10T03:06:52.000Z</published>
<updated>2017-10-10T03:06:52.000Z</updated>
<summary type="html"><blockquote>
<p><code>mocha+chai</code>是比较流行的测试框架‘套装’,能实现一些基本的前端测试如函数功能测试,模拟登陆,异步测试,流程测试等</p>
</blockquote>
<h2 id="官方文档"><a href="#官方文档" class="headerlink" title="官方文档"></a>官方文档</h2><h3 id="mocha"><a href="#mocha" class="headerlink" title="mocha"></a><span class="exturl" data-url="aHR0cDovL21vY2hhanMub3JnLw==">mocha<i class="fa fa-external-link-alt"></i></span></h3></summary>
<category term="测试" scheme="https://blog.imx0.com/categories/%E6%B5%8B%E8%AF%95/"/>
<category term="javascript" scheme="https://blog.imx0.com/tags/javascript/"/>
<category term="测试" scheme="https://blog.imx0.com/tags/%E6%B5%8B%E8%AF%95/"/>
</entry>
</feed>