Skip to content

Commit d1e8cb0

Browse files
committed
feat: update to use jsDelivr CDN as GitHub images url
1 parent 53ac33d commit d1e8cb0

File tree

49 files changed

+273
-277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+273
-277
lines changed

README.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@
3535

3636
## **BIG CHANGE!!! MOVED TO DISTRIBUTED GITHUB REPO**
3737

38-
### Focus
38+
### Focus
3939

4040
This repo will only record ideas and posts, which means I will focus on writing and learning in [jimmylv.github.io](https://github.com/JimmyLv/jimmylv.github.io) and other features will be support by other individual GitHub repo: `jimmylv.github.io/xxx`.
4141

42-
Actually the biggest benefits is that you can use this repo as git submodules of other repos, which can make things more flexible and make our life easier.
42+
Actually the biggest benefits is that you can use this repo as git submodules of other repos, which can make things more flexible and make our life easier.
4343

4444
### APIs
4545

@@ -49,11 +49,11 @@ As you can see in [JimmyLv/api](https://github.com/JimmyLv/api) repo which will
4949

5050
#TODO: add more details in wiki, and also update md images url from qiniu to github id:50
5151

52-
* [x] [JimmyLv/jekyll-blog](https://github.com/JimmyLv/jekyll-blog): `jekyll` version, which is the default blog to be published on <https://blog.jimmylv.info> | <http://jekyll.jimmylv.info>..
53-
* [ ] [JimmyLv/hexo-blog](https://github.com/JimmyLv/hexo-blog): `hexo` version, which is another alternative of `jekyll` and you can play with `nodejs` easily, <http://hexo.jimmylv.info>.
54-
* [x] [JimmyLv/Haiku](https://github.com/JimmyLv/Haiku)`react` version, which be invoke the markdown raw files from GitHub repo, and we can easily enjoy the frontend deployment, <https://haiku.jimmylv.info>
55-
* [x] [JimmyLv/nobackend.website](https://github.com/JimmyLv/nobackend.website)`angular 1.5x` version, also created for frontend but gave up because of `AngularJS` <http://nobackend.website/_ng>
56-
* [ ] [JimmyLv/gitbook](https://github.com/JimmyLv/GitBook)`gitbook` version, which can be used to generate beautiful e-book and also you just put all markdown files together. <https://www.gitbook.com/@jimmylv>
52+
- [x] [JimmyLv/jekyll-blog](https://github.com/JimmyLv/jekyll-blog): `jekyll` version, which is the default blog to be published on <https://blog.jimmylv.info> | <http://jekyll.jimmylv.info>..
53+
- [ ] [JimmyLv/hexo-blog](https://github.com/JimmyLv/hexo-blog): `hexo` version, which is another alternative of `jekyll` and you can play with `nodejs` easily, <http://hexo.jimmylv.info>.
54+
- [x] [JimmyLv/Haiku](https://github.com/JimmyLv/Haiku)`react` version, which be invoke the markdown raw files from GitHub repo, and we can easily enjoy the frontend deployment, <https://haiku.jimmylv.info>
55+
- [x] [JimmyLv/nobackend.website](https://github.com/JimmyLv/nobackend.website)`angular 1.5x` version, also created for frontend but gave up because of `AngularJS` <http://nobackend.website/_ng>
56+
- [ ] [JimmyLv/gitbook](https://github.com/JimmyLv/GitBook)`gitbook` version, which can be used to generate beautiful e-book and also you just put all markdown files together. <https://www.gitbook.com/@jimmylv>
5757

5858
### Slides
5959

@@ -68,7 +68,6 @@ nodeppt generate ./演讲 ./slides -a
6868
- `default`: GitHub Pages with `jekyll`, so easy and no configuration need and whatever the repo you are in.
6969
- `travis-ci`: Try whatever you want, I prefer to use Node to do all these stuff in one place, <https://travis-ci.org/JimmyLv/jimmylv.github.io>.
7070

71-
7271
## Related Tools
7372

7473
- [WebStrom](https://www.jetbrains.com/webstorm/)
@@ -89,4 +88,3 @@ nodeppt generate ./演讲 ./slides -a
8988
## GitHub Stargazers over time
9089

9190
[![Stargazers over time](https://starchart.cc/JimmyLv/jimmylv.github.io.svg)](https://starchart.cc/JimmyLv/jimmylv.github.io)
92-

前端/2014-09-26-write-article-use-jekyll-github-markdown.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ $ cd my-awesome-site
5252
```
5353

5454
打开浏览器可以看到:
55-
![3](https://jimmylv.github.io/images/images/tech/0926-3.png)
55+
![3](https://cdn.jsdelivr.net/gh/jimmylv/images/images/tech/0926-3.png)
5656

5757
## 使用[「JekyllBootstrap」](http://jekyllbootstrap.com/)
5858

@@ -92,7 +92,7 @@ Error: Address already in use - bind(2)
9292

9393
这个错误是因为在另外一个在和终端里面也运行了 jekyll serve,关掉之后在打开就可以看到自己的博客了。
9494

95-
![4](https://jimmylv.github.io/images/images/tech/0926-4.png)
95+
![4](https://cdn.jsdelivr.net/gh/jimmylv/images/images/tech/0926-4.png)
9696

9797
```sh
9898
$ jekyll serve
@@ -159,7 +159,7 @@ published: 表示发布与否
159159
160160
最终就选择了 Prose.io 直接在线编辑修改 GitHub 上的文章,无比方便。
161161

162-
![5](https://jimmylv.github.io/images/images/tech/0926-5.png)
162+
![5](https://cdn.jsdelivr.net/gh/jimmylv/images/images/tech/0926-5.png)
163163

164164
## 其他的快速「博客」方案
165165

前端/2015-11-10-reading-open-resource-code-from-github.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ published: True
88

99
# GitHub 开源项目:getAwesomeness
1010

11-
![](https://jimmylv.github.io/images/images/getAwesome.png)
11+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/images/getAwesome.png)
1212

1313
repo url: <https://github.com/panzhangwang/getawesomeness/>
1414

@@ -66,7 +66,7 @@ app.use(function (req, res, next) {
6666
})
6767
```
6868

69-
![](https://jimmylv.github.io/images/images/swig_404.png)
69+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/images/swig_404.png)
7070

7171
当然可以再次分层,把具体的`res.render()`函数放到不同的地方。
7272

前端/2016-03-08-introduction-of-angular-new-features-by-examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ published: True
1616

1717
本次更新的 `.component()` 方法其实就是一种更加方便定义元素指令的方式,并自带默认配置使之符合最佳实践。而组件开发的方式也就使应用更加符合 [Angular 2.0](http://www.angular.io/) 的架构风格,所以说,Angular 1.5 就是为了方便开发者能够更加顺利地过渡到 Angular 2.0。为了 Angular 2.0 的未来 Google 也是迫不得已啊,要知道很多前端开发者在经历过 Angular 1.x 的「折磨」过后都转投了其他框架的怀抱。可以说前有 [React.js](https://github.com/facebook/react) 携着组件化,虚拟 DOM ,单向数据流等利器,给前端 UI 构建掀起了一波声势浩大的函数式新潮流;后有 [Vue.js](http://vuejs.org/) 等更轻便的 MVVM 框架穷追猛赶,据说用过 Vue 的开发者都一致叫好。
1818

19-
![](https://jimmylv.github.io/images/2016/1466241519959.png)
19+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1466241519959.png)
2020

2121
- 终于支持了 **Multi-slot transclusion**
2222

@@ -99,7 +99,7 @@ AngularJS 在早些版本引入了 `controllerAs` 语法,相当于给 ViewMode
9999
this.name = 'JimmyLv';
100100
});
101101

102-
![](https://jimmylv.github.io/images/2016/1466241548419.png)
102+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1466241548419.png)
103103

104104
但与此同时,在指令使用 `controllerAs` 语法也会遇到问题:
105105

前端/2016-06-10-thirteen-steps-to-a-faster-web-app.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const MyComponent = () => (
127127
128128
如果你正在使用 [React](https://facebook.github.io/react/),[Ember](http://emberjs.com/),[Angular](https://angularjs.org/) 或者其他 DOM 操作库,使用 array-ids(或者 Angular 1.x 中的 track-by 特性)非常有助于实现高性能,对于动态网页尤其如此。我们已经在上一篇程序衡量标准的文章中看到这个特性的效果了: [More Benchmarks: Virtual DOM vs Angular 1 & 2 vs Mithril.js vs cito.js vs The Rest (Updated and Improved!)](https://auth0.com/blog/2016/01/11/updated-and-improved-more-benchmarks-virtual-dom-vs-angular-12-vs-mithril-js-vs-the-rest/)。
129129
130-
![Benchmarks showing the difference between array-ids and no array-ids https://cdn.auth0.com/blog/newdombenchs2/usedheap.svg](https://jimmylv.github.io/images/2016/1465566744065.png)
130+
![Benchmarks showing the difference between array-ids and no array-ids https://cdn.auth0.com/blog/newdombenchs2/usedheap.svg](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1465566744065.png)
131131
132132
> The main concept behind this feature is to reuse as much existing nodes as possible. **Array ids** allow DOM-manipulation engines to "know" when a certain node can be mapped to a certain element in an array. Without **array-ids** or **track-by** most libraries resort to destroying the existing nodes and creating new ones. This impairs performance.
133133
@@ -157,7 +157,7 @@ const MyComponent = () => (
157157
158158
越来越多的浏览器都开始支持 HTTP/2。这可能听起来没有必要,但是 HTTP/2 为同一服务器的并发连接问题带来了很多好处。换句话说,如果有很多小型资源需要加载(如果你打包过的话就没有必要了),在延迟和性能方面 HTTP/2 秒杀 HTTP/1。试试 [Akamai 的 HTTP/2 demo](https://http2.akamai.com/demo),可以在最新的浏览器中看到区别。
159159
160-
![](https://jimmylv.github.io/images/2016/1465566806854.png)
160+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1465566806854.png)
161161
162162
## 6. Profile Your App | 6. 应用性能分析
163163
@@ -169,13 +169,13 @@ const MyComponent = () => (
169169
170170
对于 Web 应用来说,延迟时间是最大的抱怨之一,所以你需要确保数据的加载和显示都尽可能得快。Chrome 提供了非常棒的性能分析工具。特别是 Chrome Dev Tools 中的时间线和网络视图都对于定位延迟问题有着很大的帮助:
171171
172-
![](https://jimmylv.github.io/images/2016/1465566860809.png) 
172+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1465566860809.png) 
173173
174174
> The timeline view can help in finding long running operations.
175175
176176
时间线视图可以帮忙找到运行时间较长的操作。
177177
178-
![](https://jimmylv.github.io/images/2016/1465566882266.png)
178+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1465566882266.png)
179179
180180
> The network view can help identify additional latency generated by slow requests or serial access to an endpoint.
181181
@@ -189,7 +189,7 @@ const MyComponent = () => (
189189
190190
CPU 性能分析也可以在 Chrome Dev Tools 中找到。看看这篇来自 Google 官方文档中的文章 [Profiling JavaScript Performance](https://developer.chrome.com/devtools/docs/cpu-profiling)。
191191
192-
![](https://jimmylv.github.io/images/2016/1465566917028.png)
192+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1465566917028.png)
193193
194194
> Finding performance cost centers lets you target optimizations effectively.
195195
@@ -215,7 +215,7 @@ CPU 性能分析也可以在 Chrome Dev Tools 中找到。看看这篇来自 Goo
215215
216216
负载均衡就跟使用某个 round-robin(循环)解决方案一样简单,可以基于一个 [nginx 反向代理](http://nginx.org/en/docs/http/load_balancing.html) ,或者基于一个成熟的分布式网络,比如 [Cloudflare](https://www.cloudflare.com/) 或者 [Amazon CloudFront](https://aws.amazon.com/cloudfront/)。
217217
218-
![](https://jimmylv.github.io/images/2016/1465566942211.png)
218+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1465566942211.png)
219219
220220
> > The above diagram is based on [this one](http://docs.citrix.com/content/dam/docs/en-us/legacy-edocs/netscaler-traffic-management-10-5-map/LB-Round_Robin_Mechanism.PNG) from Citrix.
221221
> > For load-balancing to be really useful, dynamic and static content should be split for easy concurrent access. In other words, serial access to elements impairs the ability of the load balancer to find the best way to split the work. At the same time, concurrent access to resources can improve startup times.

前端/2016-07-04-rules-for-structuring-redux-applications.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ rootReducer.js
114114
115115
Rich Hickey 在他的 Ruby Conf 2012 演讲 [Simplicity Matters](https://www.youtube.com/watch?v=rI8tNMsozo0) 中,将复杂度定义为一种**编织**(或交织)的东西。当你把模块耦合在一起,你将会从代码当中看到某种跟现实中的绳结或者辫子一样的形态。
116116

117-
![](https://jimmylv.github.io/images/2016/1467619650283.png)
117+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1467619650283.png)
118118

119119
> The relevence of complexity to project structure is that when you place objects in **close proximity** to one another, the **barrier to couple** them lowers dramatically.
120120
@@ -285,7 +285,7 @@ a(); // ???
285285
286286
换句话来说,制造循环依赖,你就是**在用最糟糕的方式在打着绳子的结**。想象一下一个模块就是一缕头发,然后模块之间相互依赖着形成了一个巨大的,混乱的毛团。
287287

288-
![](https://jimmylv.github.io/images/2016/1467640142143.png)
288+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1467640142143.png)
289289

290290
> Whenever you want to use a small module within the hairball, you will have no choice but to pull in the giant mess. And even worse, when you change something inside the hairball, it would be hard _not_ to break something else.
291291

前端/2016-07-07-what-the-flux-on-flux-ddd-and-cqrs.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ published: True
5252
5353
在 MVC 当中,一个 Model 可以被多个 Views 读取,并且可以被多个 Controllers 进行更新。在大型应用当中,单个 Model 会导致多个 Views 去通知 Controllers,并可能触发更多的 Model 更新,这样结果就会变得非常复杂。
5454

55-
![](https://jimmylv.github.io/images/2016/1467895052725.png)
55+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1467895052725.png)
5656

5757
> Flux attempts to solve this complexity by forcing a unidirectional data flow. In this architecture, Views query Stores (not Models), and user interactions result in Actions that are submitted to a centralized Dispatcher. When the Actions are dispatched, Stores can then update themselves accordingly and notify Views of any changes. These changes in the Store prompts Views to query for new data.
5858
5959
Flux 试图通过强制单向数据流来解决这个复杂度。在这种架构当中,Views 查询 Stores(而不是 Models),并且用户交互将会触发 Actions,Actions 则会被提交到一个集中的 Dispatcher 当中。当 Actions 被派发之后,Stores 将会随之更新自己并且通知 Views 进行修改。这些 Store 当中的修改会进一步促使 Views 查询新的数据。
6060

61-
![](https://jimmylv.github.io/images/2016/1467895448296.png)
61+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1467895448296.png)
6262

6363
> The main difference between MVC and Flux is the separation of queries and updates. In MVC, the Model is both updated by the Controller _and_ queried by the View. In Flux, the data that a View gets from a Store is read-only. Stores can only be updated through Actions, which would affect the Stores themselves _not_ the read-only data.
6464
@@ -405,7 +405,7 @@ e.g. `ShoppingCartActionCreators.addItem(…)`
405405
2. 一个处理显示汇总,税,配送和包装,以及总数的视图。
406406
3. 一个处理购物车中物品的个数,以及下拉详情菜单的视图。
407407

408-
![](https://jimmylv.github.io/images/2016/1467904299891.png)
408+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1467904299891.png)
409409

410410
> In this system, we don’t want to tie different views and controllers directly to a ShoppingCart model because changes to the model causes a complex data flow that is hard to reason about.
411411

前端/2016-12-07-react-testing-with-enzyme.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ published: True
1414

1515
React.js 作为前端框架的后起之秀,却在 2015 年携着虚拟 DOM,组件化,单向数据流等利器,给前端 UI 构建掀起了一波声势浩大的函数式新潮流。虽然说组件化不是 React 最先提出来的,但却是 React 使得组件化在前端世界里发扬光大的,而现在几乎所有的所谓现代化 UI 框架比如 Angular 或者 Vue 都已经将组件化作为框架的立足之本。
1616

17-
![](https://jimmylv.github.io/images/2016/1481267000925.png)
17+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1481267000925.png)
1818

1919
React 已经让 UI 测试变得容易很多,React 组件都可以被简化为这样一个表达式,即 `UI = f(data)`,这个纯函数返回的只是一个描述 UI 组件应该是什么样子的虚拟 DOM,本质上就是一个树形的数据结构。给这个纯函数输入一些应用程序的状态,就会得到相应的 UI 描述的输出,这个过程不会去直接操作实际的 UI 元素,也不会产生所谓的副作用。
2020

2121
## React 组件树的测试
2222

2323
按理来说按照纯函数这样的思路,React 组件的测试应该很简单的说。但与此同时对于(渲染出 UI 的)组件树进行测试依然存在一个问题,从下图中可以看出,越处于上层的组件,其复杂度必然会随之提高。对于最底层的子组件来说,我们可以很容易得将其进行渲染并测试其逻辑的正确与否,但对于较上层的父组件来说,通常来说就需要对其所包含的所有子组件都进行预先渲染,甚至于最上面的组件需要渲染出整个 UI 页面的真实 DOM 节点才能对其进行测试,这显然是不可取的。
2424

25-
![Components-Tree](https://jimmylv.github.io/images/2016/1481119659338.png)
25+
![Components-Tree](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1481119659338.png)
2626

2727
> Shallow rendering lets you render a component "one level deep" and assert facts about what its render method returns, without worrying about the behavior of child components, which are not instantiated or rendered. This does not require a DOM.
2828
@@ -38,7 +38,7 @@ React 已经让 UI 测试变得容易很多,React 组件都可以被简化为
3838

3939
对比一下两者 `facebook/react-addons-test-utils` vs `airbnb/enzyme` 的 API 就一目了然,立见分明:
4040

41-
![](https://jimmylv.github.io/images/2016/1481121353201.png)
41+
![](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1481121353201.png)
4242

4343
## Enzyme 的三种渲染方法
4444

@@ -171,4 +171,4 @@ Enzyme 推荐在测试环境中使用 [react-native-mock](https://github.com/Rea
171171
172172
> **技术雷达**:我们非常享受 Enzyme 为 React.js 应用提供的快速组件级 UI 测试功能。与许多其他基于快照的测试框架不同,Enzyme 允许开发者在不进行设备渲染的情况下做测试,从而实现速度更快,粒度更小的测试。在开发 React 应用时,我们经常需要做大量的功能测试,而 Enzyme 可以在大规模地减少功能测试数量上做出贡献。
173173
174-
![TechRadar](https://jimmylv.github.io/images/2016/1481128632569.png)
174+
![TechRadar](https://cdn.jsdelivr.net/gh/jimmylv/images/2016/1481128632569.png)

0 commit comments

Comments
 (0)