Skip to content

Commit 732f8bd

Browse files
committed
rebuilding site 2019年11月27日 星期三 18时01分48秒 CST
1 parent 693b5f1 commit 732f8bd

File tree

19 files changed

+1040
-80
lines changed

19 files changed

+1040
-80
lines changed

categories/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,21 @@ <h2 class="f1">
192192
</a>
193193
</h2>
194194

195+
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
196+
<div class="bg-white mb3 pa4 gray overflow-hidden">
197+
<span class="f6 db">Posts</span>
198+
<h1 class="f3 near-black">
199+
<a href="https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/" class="link black dim">
200+
生产环境内存泄露分析
201+
</a>
202+
</h1>
203+
<div class="nested-links f5 lh-copy nested-copy-line-height">
204+
项目架构 java+grpc+rails 因生产环境频繁出现宕机的情况,平均一周需要重启下服务器,这谁顶得住啊。。这个问题必须解决。然后重启一次服务器并每天记录cpu、内存
205+
</div>
206+
</div>
207+
</div>
208+
209+
195210
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
196211
<div class="bg-white mb3 pa4 gray overflow-hidden">
197212
<span class="f6 db">Posts</span>

categories/index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<item>
2323
<title>技术</title>
2424
<link>https://johnnyting.github.io/categories/%E6%8A%80%E6%9C%AF/</link>
25-
<pubDate>Wed, 06 Nov 2019 14:18:24 +0800</pubDate>
25+
<pubDate>Wed, 27 Nov 2019 16:59:43 +0800</pubDate>
2626

2727
<guid>https://johnnyting.github.io/categories/%E6%8A%80%E6%9C%AF/</guid>
2828
<description></description>

categories/技术/index.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<meta property="og:description" content="程序员的日常。。" />
3939
<meta property="og:type" content="website" />
4040
<meta property="og:url" content="https://johnnyting.github.io/categories/%E6%8A%80%E6%9C%AF/" />
41-
<meta property="og:updated_time" content="2019-11-06T14:18:24&#43;08:00"/>
41+
<meta property="og:updated_time" content="2019-11-27T16:59:43&#43;08:00"/>
4242

4343
<meta itemprop="name" content="技术">
4444
<meta itemprop="description" content="程序员的日常。。">
@@ -167,6 +167,23 @@ <h1 class="f2 f-subheadline-l fw2 white-90 mb0 lh-title">
167167
<div class="relative w-100 mb4 bg-white">
168168
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
169169
<div class="bg-white mb3 pa4 gray overflow-hidden">
170+
<span class="f6 db">Posts</span>
171+
<h1 class="f3 near-black">
172+
<a href="https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/" class="link black dim">
173+
生产环境内存泄露分析
174+
</a>
175+
</h1>
176+
<div class="nested-links f5 lh-copy nested-copy-line-height">
177+
项目架构 java+grpc+rails 因生产环境频繁出现宕机的情况,平均一周需要重启下服务器,这谁顶得住啊。。这个问题必须解决。然后重启一次服务器并每天记录cpu、内存
178+
</div>
179+
</div>
180+
</div>
181+
182+
</div>
183+
184+
<div class="relative w-100 mb4 bg-white">
185+
<div class="relative w-100 mb4 bg-white nested-copy-line-height">
186+
<div class="bg-white mb3 pa4 gray overflow-hidden">
170187
<span class="f6 db">Posts</span>
171188
<h1 class="f3 near-black">
172189
<a href="https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/" class="link black dim">

categories/技术/index.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@
66
<description>Recent content in 技术 on Johnny Ting</description>
77
<generator>Hugo -- gohugo.io</generator>
88
<language>zh-CN</language>
9-
<lastBuildDate>Wed, 06 Nov 2019 14:18:24 +0800</lastBuildDate>
9+
<lastBuildDate>Wed, 27 Nov 2019 16:59:43 +0800</lastBuildDate>
1010

1111
<atom:link href="https://johnnyting.github.io/categories/%E6%8A%80%E6%9C%AF/index.xml" rel="self" type="application/rss+xml" />
1212

1313

14+
<item>
15+
<title>生产环境内存泄露分析</title>
16+
<link>https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/</link>
17+
<pubDate>Wed, 27 Nov 2019 16:59:43 +0800</pubDate>
18+
19+
<guid>https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/</guid>
20+
<description>项目架构 java+grpc+rails 因生产环境频繁出现宕机的情况,平均一周需要重启下服务器,这谁顶得住啊。。这个问题必须解决。然后重启一次服务器并每天记录cpu、内存</description>
21+
</item>
22+
1423
<item>
1524
<title>Sidekiq后台任务的简单配置</title>
1625
<link>https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/</link>

index.html

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<meta property="og:description" content="程序员的日常。。" />
3939
<meta property="og:type" content="website" />
4040
<meta property="og:url" content="https://johnnyting.github.io/" />
41-
<meta property="og:updated_time" content="2019-11-06T14:18:24&#43;08:00"/>
41+
<meta property="og:updated_time" content="2019-11-27T16:59:43&#43;08:00"/>
4242

4343
<meta itemprop="name" content="Johnny Ting">
4444
<meta itemprop="description" content="程序员的日常。。">
@@ -190,14 +190,14 @@ <h1 class="flex-none">
190190

191191
<div class="blah w-100">
192192
<h1 class="f3 fw1 athelas mt0 lh-title">
193-
<a href="https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/" class="color-inherit dim link">
194-
Sidekiq后台任务的简单配置
193+
<a href="https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/" class="color-inherit dim link">
194+
生产环境内存泄露分析
195195
</a>
196196
</h1>
197197
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
198-
reference: sidekiq官方文档 ruby-china sidekiq-cron 1.本地安装redis,macos这里使用homebrew安装 =&gt; brew install redis To have launchd start redis now and restart at login: brew services start redis Or, if you don't want/need a background
198+
项目架构 java+grpc+rails 因生产环境频繁出现宕机的情况,平均一周需要重启下服务器,这谁顶得住啊。。这个问题必须解决。然后重启一次服务器并每天记录cpu、内存
199199
</div>
200-
<a href="https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">read more</a>
200+
<a href="https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">read more</a>
201201

202202
</div>
203203
</div>
@@ -214,14 +214,14 @@ <h1 class="f3 fw1 athelas mt0 lh-title">
214214

215215
<div class="blah w-100">
216216
<h1 class="f3 fw1 athelas mt0 lh-title">
217-
<a href="https://johnnyting.github.io/posts/%E4%BF%AE%E6%94%B9puma%E6%BA%90%E7%A0%81%E4%B8%ADget%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80%E9%95%BF%E5%BA%A6%E7%9A%84%E6%9C%80%E5%A4%A7%E5%80%BC/" class="color-inherit dim link">
218-
修改puma源码中GET请求地址长度的最大值
217+
<a href="https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/" class="color-inherit dim link">
218+
Sidekiq后台任务的简单配置
219219
</a>
220220
</h1>
221221
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
222-
说一下我遇到的问题,在一个GET请求的接口中,由于请求字符串太长而导致的错误,因为是之前的旧项目,如果将接口改成POST请求的话,很多地方都
222+
reference: sidekiq官方文档 ruby-china sidekiq-cron 1.本地安装redis,macos这里使用homebrew安装 =&gt; brew install redis To have launchd start redis now and restart at login: brew services start redis Or, if you don't want/need a background
223223
</div>
224-
<a href="https://johnnyting.github.io/posts/%E4%BF%AE%E6%94%B9puma%E6%BA%90%E7%A0%81%E4%B8%ADget%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80%E9%95%BF%E5%BA%A6%E7%9A%84%E6%9C%80%E5%A4%A7%E5%80%BC/" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">read more</a>
224+
<a href="https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">read more</a>
225225

226226
</div>
227227
</div>
@@ -238,14 +238,14 @@ <h1 class="f3 fw1 athelas mt0 lh-title">
238238

239239
<div class="blah w-100">
240240
<h1 class="f3 fw1 athelas mt0 lh-title">
241-
<a href="https://johnnyting.github.io/posts/%E5%BD%93%E5%89%8D%E7%AB%AF%E6%8E%A5%E5%8F%97json%E6%95%B0%E6%8D%AEkey%E4%B8%BA%E6%95%B0%E5%AD%97%E6%97%B6%E8%87%AA%E5%8A%A8%E6%8E%92%E5%BA%8F%E7%9A%84%E9%97%AE%E9%A2%98/" class="color-inherit dim link">
242-
当前端接受json数据key为数字时自动排序的问题
241+
<a href="https://johnnyting.github.io/posts/%E4%BF%AE%E6%94%B9puma%E6%BA%90%E7%A0%81%E4%B8%ADget%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80%E9%95%BF%E5%BA%A6%E7%9A%84%E6%9C%80%E5%A4%A7%E5%80%BC/" class="color-inherit dim link">
242+
修改puma源码中GET请求地址长度的最大值
243243
</a>
244244
</h1>
245245
<div class="f6 f5-l lh-copy nested-copy-line-height nested-links">
246-
今天遇到一个奇葩问题,就是当后端排序后的json数据(此json数据的key为数字字符串),前端展示的始终不是我想要的排序数据。 后端返回实际
246+
说一下我遇到的问题,在一个GET请求的接口中,由于请求字符串太长而导致的错误,因为是之前的旧项目,如果将接口改成POST请求的话,很多地方都
247247
</div>
248-
<a href="https://johnnyting.github.io/posts/%E5%BD%93%E5%89%8D%E7%AB%AF%E6%8E%A5%E5%8F%97json%E6%95%B0%E6%8D%AEkey%E4%B8%BA%E6%95%B0%E5%AD%97%E6%97%B6%E8%87%AA%E5%8A%A8%E6%8E%92%E5%BA%8F%E7%9A%84%E9%97%AE%E9%A2%98/" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">read more</a>
248+
<a href="https://johnnyting.github.io/posts/%E4%BF%AE%E6%94%B9puma%E6%BA%90%E7%A0%81%E4%B8%ADget%E8%AF%B7%E6%B1%82%E5%9C%B0%E5%9D%80%E9%95%BF%E5%BA%A6%E7%9A%84%E6%9C%80%E5%A4%A7%E5%80%BC/" class="ba b--moon-gray bg-light-gray br2 color-inherit dib f7 hover-bg-moon-gray link mt2 ph2 pv1">read more</a>
249249

250250
</div>
251251
</div>
@@ -261,6 +261,12 @@ <h1 class="f3 fw1 athelas mt0 lh-title">
261261
<h1 class="f3">More</h1>
262262

263263

264+
<h2 class="f5 fw4 mb4 dib mr3">
265+
<a href="https://johnnyting.github.io/posts/%E5%BD%93%E5%89%8D%E7%AB%AF%E6%8E%A5%E5%8F%97json%E6%95%B0%E6%8D%AEkey%E4%B8%BA%E6%95%B0%E5%AD%97%E6%97%B6%E8%87%AA%E5%8A%A8%E6%8E%92%E5%BA%8F%E7%9A%84%E9%97%AE%E9%A2%98/" class="link black dim">
266+
当前端接受json数据key为数字时自动排序的问题
267+
</a>
268+
</h2>
269+
264270
<h2 class="f5 fw4 mb4 dib mr3">
265271
<a href="https://johnnyting.github.io/posts/%E4%BD%BF%E7%94%A8vscode%E5%A6%82%E4%BD%95%E6%9D%A5debug-rails%E5%BA%94%E7%94%A8/" class="link black dim">
266272
使用vscode如何来debug Rails应用
@@ -279,12 +285,6 @@ <h2 class="f5 fw4 mb4 dib mr3">
279285
</a>
280286
</h2>
281287

282-
<h2 class="f5 fw4 mb4 dib mr3">
283-
<a href="https://johnnyting.github.io/posts/%E4%BD%BF%E7%94%A8%E5%91%BD%E4%BB%A4%E5%BF%AB%E9%80%9F%E7%94%9F%E6%88%90readmegitignore%E6%96%87%E4%BB%B6/" class="link black dim">
284-
使用命令快速生成readme、gitignore文件
285-
</a>
286-
</h2>
287-
288288

289289

290290

index.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@
66
<description>Recent content on Johnny Ting</description>
77
<generator>Hugo -- gohugo.io</generator>
88
<language>zh-CN</language>
9-
<lastBuildDate>Wed, 06 Nov 2019 14:18:24 +0800</lastBuildDate>
9+
<lastBuildDate>Wed, 27 Nov 2019 16:59:43 +0800</lastBuildDate>
1010

1111
<atom:link href="https://johnnyting.github.io/index.xml" rel="self" type="application/rss+xml" />
1212

1313

14+
<item>
15+
<title>生产环境内存泄露分析</title>
16+
<link>https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/</link>
17+
<pubDate>Wed, 27 Nov 2019 16:59:43 +0800</pubDate>
18+
19+
<guid>https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/</guid>
20+
<description>项目架构 java+grpc+rails 因生产环境频繁出现宕机的情况,平均一周需要重启下服务器,这谁顶得住啊。。这个问题必须解决。然后重启一次服务器并每天记录cpu、内存</description>
21+
</item>
22+
1423
<item>
1524
<title>Sidekiq后台任务的简单配置</title>
1625
<link>https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/</link>

posts/index.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<meta property="og:description" content="程序员的日常。。" />
3939
<meta property="og:type" content="website" />
4040
<meta property="og:url" content="https://johnnyting.github.io/posts/" />
41-
<meta property="og:updated_time" content="2019-11-06T14:18:24&#43;08:00"/>
41+
<meta property="og:updated_time" content="2019-11-27T16:59:43&#43;08:00"/>
4242

4343
<meta itemprop="name" content="Posts">
4444
<meta itemprop="description" content="程序员的日常。。">
@@ -162,6 +162,21 @@ <h1 class="f2 f-subheadline-l fw2 white-90 mb0 lh-title">
162162

163163
<div class="relative w-100 w-30-l mb4 bg-white"><div class="relative w-100 mb4 bg-white nested-copy-line-height">
164164
<div class="bg-white mb3 pa4 gray overflow-hidden">
165+
<span class="f6 db">Posts</span>
166+
<h1 class="f3 near-black">
167+
<a href="https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/" class="link black dim">
168+
生产环境内存泄露分析
169+
</a>
170+
</h1>
171+
<div class="nested-links f5 lh-copy nested-copy-line-height">
172+
项目架构 java+grpc+rails 因生产环境频繁出现宕机的情况,平均一周需要重启下服务器,这谁顶得住啊。。这个问题必须解决。然后重启一次服务器并每天记录cpu、内存
173+
</div>
174+
</div>
175+
</div>
176+
</div>
177+
178+
<div class="relative w-100 w-30-l mb4 bg-white"><div class="relative w-100 mb4 bg-white nested-copy-line-height">
179+
<div class="bg-white mb3 pa4 gray overflow-hidden">
165180
<span class="f6 db">Posts</span>
166181
<h1 class="f3 near-black">
167182
<a href="https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/" class="link black dim">
@@ -293,21 +308,6 @@ <h1 class="f3 near-black">
293308
</div>
294309
</div>
295310
</div>
296-
</div>
297-
298-
<div class="relative w-100 w-30-l mb4 bg-white"><div class="relative w-100 mb4 bg-white nested-copy-line-height">
299-
<div class="bg-white mb3 pa4 gray overflow-hidden">
300-
<span class="f6 db">Posts</span>
301-
<h1 class="f3 near-black">
302-
<a href="https://johnnyting.github.io/posts/rails%E4%B8%ADtry%E7%9A%84%E7%94%A8%E6%B3%95/" class="link black dim">
303-
Rails中try的用法
304-
</a>
305-
</h1>
306-
<div class="nested-links f5 lh-copy nested-copy-line-height">
307-
我们经常会遇到的下面的场景: @person &amp;&amp; @persion.name # 需确保@person不是nil,否则会报错 NoMethodError: undefined method `name' for nil:NilClass 用 try 改写: @person.try(:name) # 如果@person为nil则返回ni
308-
</div>
309-
</div>
310-
</div>
311311
</div>
312312

313313
</section>

posts/index.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@
66
<description>Recent content in Posts on Johnny Ting</description>
77
<generator>Hugo -- gohugo.io</generator>
88
<language>zh-CN</language>
9-
<lastBuildDate>Wed, 06 Nov 2019 14:18:24 +0800</lastBuildDate>
9+
<lastBuildDate>Wed, 27 Nov 2019 16:59:43 +0800</lastBuildDate>
1010

1111
<atom:link href="https://johnnyting.github.io/posts/index.xml" rel="self" type="application/rss+xml" />
1212

1313

14+
<item>
15+
<title>生产环境内存泄露分析</title>
16+
<link>https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/</link>
17+
<pubDate>Wed, 27 Nov 2019 16:59:43 +0800</pubDate>
18+
19+
<guid>https://johnnyting.github.io/posts/%E7%94%9F%E4%BA%A7%E7%8E%AF%E5%A2%83%E5%86%85%E5%AD%98%E6%B3%84%E9%9C%B2%E5%88%86%E6%9E%90/</guid>
20+
<description>项目架构 java+grpc+rails 因生产环境频繁出现宕机的情况,平均一周需要重启下服务器,这谁顶得住啊。。这个问题必须解决。然后重启一次服务器并每天记录cpu、内存</description>
21+
</item>
22+
1423
<item>
1524
<title>Sidekiq后台任务的简单配置</title>
1625
<link>https://johnnyting.github.io/posts/sidekiq%E5%90%8E%E5%8F%B0%E4%BB%BB%E5%8A%A1%E7%9A%84%E7%AE%80%E5%8D%95%E9%85%8D%E7%BD%AE/</link>

posts/page/2/index.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
<meta property="og:description" content="程序员的日常。。" />
3939
<meta property="og:type" content="website" />
4040
<meta property="og:url" content="https://johnnyting.github.io/posts/" />
41-
<meta property="og:updated_time" content="2019-05-11T14:36:35&#43;08:00"/>
41+
<meta property="og:updated_time" content="2019-05-11T18:33:21&#43;08:00"/>
4242

4343
<meta itemprop="name" content="Posts">
4444
<meta itemprop="description" content="程序员的日常。。">
@@ -162,6 +162,21 @@ <h1 class="f2 f-subheadline-l fw2 white-90 mb0 lh-title">
162162

163163
<div class="relative w-100 w-30-l mb4 bg-white"><div class="relative w-100 mb4 bg-white nested-copy-line-height">
164164
<div class="bg-white mb3 pa4 gray overflow-hidden">
165+
<span class="f6 db">Posts</span>
166+
<h1 class="f3 near-black">
167+
<a href="https://johnnyting.github.io/posts/rails%E4%B8%ADtry%E7%9A%84%E7%94%A8%E6%B3%95/" class="link black dim">
168+
Rails中try的用法
169+
</a>
170+
</h1>
171+
<div class="nested-links f5 lh-copy nested-copy-line-height">
172+
我们经常会遇到的下面的场景: @person &amp;&amp; @persion.name # 需确保@person不是nil,否则会报错 NoMethodError: undefined method `name' for nil:NilClass 用 try 改写: @person.try(:name) # 如果@person为nil则返回ni
173+
</div>
174+
</div>
175+
</div>
176+
</div>
177+
178+
<div class="relative w-100 w-30-l mb4 bg-white"><div class="relative w-100 mb4 bg-white nested-copy-line-height">
179+
<div class="bg-white mb3 pa4 gray overflow-hidden">
165180
<span class="f6 db">Posts</span>
166181
<h1 class="f3 near-black">
167182
<a href="https://johnnyting.github.io/posts/ruby%E4%B8%AD%E7%A5%9E%E5%A5%87%E7%9A%84%E7%AC%A6%E5%8F%B7/" class="link black dim">
@@ -293,21 +308,6 @@ <h1 class="f3 near-black">
293308
</div>
294309
</div>
295310
</div>
296-
</div>
297-
298-
<div class="relative w-100 w-30-l mb4 bg-white"><div class="relative w-100 mb4 bg-white nested-copy-line-height">
299-
<div class="bg-white mb3 pa4 gray overflow-hidden">
300-
<span class="f6 db">Posts</span>
301-
<h1 class="f3 near-black">
302-
<a href="https://johnnyting.github.io/posts/ruby%E4%B8%AD%E7%9A%84%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F/" class="link black dim">
303-
第十四章、ruby中的正则表达式
304-
</a>
305-
</h1>
306-
<div class="nested-links f5 lh-copy nested-copy-line-height">
307-
Ruby的正则表达式 在这部分和教程中我们将讨论正则表达式。 正则表达式用于文本搜索和更高级的文本操作。内建正则表达式的工具如grep、sed;
308-
</div>
309-
</div>
310-
</div>
311311
</div>
312312

313313
</section>

0 commit comments

Comments
 (0)