[T] refactor

This commit is contained in:
Phodal HUANG 2017-09-17 15:57:16 +08:00
parent c76e934b9f
commit eeba27bdd3
No known key found for this signature in database
GPG key ID: 4D43418992F7BD15
23 changed files with 1756 additions and 1346 deletions

View file

@ -0,0 +1,17 @@
创建开源项目
---
取一个好的名字
---
挑选好 LICENSE
---
官方主页
---
GitHub Pages

View file

@ -1,4 +1,4 @@
#创建项目文档
# 创建项目文档
我们需要为我们的项目创建一个文档,通常我们可以将核心代码以外的东西都称为文档:

View file

@ -1,6 +1,6 @@
#构建GitHub项目
# 构建GitHub项目
##如何用好GitHub
## 如何用好GitHub
如何用好GitHub,并实践一些敏捷软件开发是一个很有意思的事情.我们可以在上面做很多事情,从测试到CI,再到自动部署.

View file

@ -1,4 +1,4 @@
#测试
# 改善 GitHub 项目代码质量:测试
##TDD

View file

@ -1,4 +1,4 @@
#重构
# 改善 GitHub 项目代码质量:重构
或许你应该知道了,重构是怎样的,你也知道重构能带来什么。在我刚开始学重构和设计模式的时候,我需要去找一些好的示例,以便于我更好的学习。有时候不得不创造一些更好的场景,来实现这些功能。
@ -8,7 +8,7 @@
艺,需要有创造性的方法。
##为什么重构?
## 为什么重构?
> 为了更好的代码。
@ -24,7 +24,7 @@
让我们来看看我们的第一个训练,相当有挑战性。
##重构uMarkdown
## 重构uMarkdown
代码及setup请见github: [js-refactor](https://github.com/artisanstack/js-refactor)

View file

@ -0,0 +1,132 @@
除了擅长编写 md 电子书来攒 star我还写了一系列的开源软件也掌握了一些项目运营的技巧。
**开源并不是你把软件、README 写好就行了,还有详细的文档、示例程序等等**。
**开源也不是你的项目好了,就会有一堆人参与进来**。
**开源还要你帮助别人解决 Bug……**。
**人们做事都是有原因的**,即动机。再举例一下,如果你的项目不够火,别人都没听过,那么**写到简历上可能没啥用**。
Marketing First
---
开源需要一些营销的技巧,这些技巧可以帮你吸引关注。举个简单的例子,司徒正美的 [avalon](https://github.com/RubyLouvre/avalon) 框架出身得很早,也 MV* 方面也做得很不错,但是在 marketing 上就……。以至于国内的很多前端,都不了解这个框架,要不今天在国内可能就是 AVRR 四大框架了。
Vue 不是因为好用,而一下子火了。这一点我印象特别深,当时在 GitHub Trending 上看到了这个项目,发现它还不能很好地 work。
而如文章 《[FIRST WEEK OF LAUNCHING VUE.JS](http://blog.evanyou.me/2014/02/11/first-week-of-launching-an-oss-project/)》所说,项目刚开始的时候作者做了一系列的营销计划:
- HackerNews
- Reddit /r/javascript
- EchoJS
- The DailyJS blog
- JavaScript Weekly
- Maintain a project Twitter account维护项目的 Vue 账户)
除此,文中还提到了一篇文章《[How to Spread The Word About Your Code](https://hacks.mozilla.org/2013/05/how-to-spread-the-word-about-your-code/?utm_source=statuscode&utm_medium=email)》 。
这一点相当的有意思,如果你的想法好的话,那么大家都会肯定,点下链接,为你来个 star。那么你就获得更好的动力去做这件事。项目也在开头的时候获得了相当多的关注。而如果大家觉得你的项目没有新意的话那么你懂的~。
除此,还有一种可能是,你的 ID 不够 fancy即你在社区的影响上比较少。此时就需要**一点点慢慢积累人气**了。当你积累了一些人气,你就能和松本行弘一样,在创建 mRuby 的时候就有 1000+ 的 star。并且在社区上还有一些相关的文章介绍各个头条也由他的粉丝发了上去。如一年多以前我创建了 [mole](https://github.com/phodal/mole) 项目。
![Mole](mole.png)
当时,是为了给自己做一个基于 GitHub 云笔记的工具,在完成度到一定程度的时候。我在我的微信公从号上发了相关的介绍,第二天就有 100+ 的 star 了,还接收至最一些鼓舞的话语。对应于国内则有:
- 极客头条
- 掘金
- 开发者头条
- v2ex
- 知乎
- 不成器的微博
所以,你觉得呢?
编写 README
---
在一个开源项目里README 是最重要的内容。它快速地介绍了这个项目,并决定了它能不能吸引用户:
- **这个项目做什么?**
- **它解决了什么问题**
- **它有什么特性**
— **hello, world 示例**
### 这个项目做什么——一句话文案
GitHub 的 Description 是我们在 Hacking News、GitHub Trneding 等等,第一时间看到的介绍。也是我们能快速介绍给别人的东西,如下图所示:
![GitHub Trending](./img/github-trending-example.png)
这一句话,必须简单明了也介绍,它是干什么的。
如 Angular 的一句话方案是One framework. Mobile & desktop.
而 React 是A declarative, efficient, and flexible JavaScript library for building user interfaces.
Vue 则是A progressive, incrementally-adoptable JavaScript framework for building UI on the web.
### 它解决了什么问题
上面的一句话描述,它不能很好地说明,它能解决什么问题。
如下是今天在 GitHub Trending 上榜的 RPC 项目的简介:
> Most machines on internet communicate with each other via TCP/IP. However TCP/IP only guarantees reliable data transmissions, we need to abstract more to build services:
![RPC 开源项目](./img/rpc-example.png)
以上便是这个项目能解决的问题,不过这个项目能解决的问题倒是比较长,哈哈哈。
### 它有什么特性
当我们有 A、B、C 几个不同的框架的时候,作为一个开发人员,就需要对比他们的特性,。如下是 Go 语言实现的 MQTT 示例:
![GO MQTT 示例](./img/go-mqtt.png)
这个项目只支持的 Qos 级别为 0。如果我们需要的级别是 1那么就不能用这个项目了。
又比如 lodash 项目:
> Lodash makes JavaScript easier by taking the hassle out of working with arrays,
numbers, objects, strings, etc. Lodashs modular methods are great for:
- Iterating arrays, objects, & strings
- Manipulating & testing values
- Creating composite functions
你会怎么写?
### hello, world 示例
在我们看完了上面的介绍之后,紧接着就是一个 hello, world 的示例。如 React 的示例:
```
class HelloMessage extends React.Component {
render() {
return <div>Hello {this.props.name}</div>;
}
}
ReactDOM.render(
<HelloMessage name="John" />,
document.getElementById('container')
);
```
这个
技术文档——手把手教会别人
---
示例程序
---
吸引贡献者
---

View file

File diff suppressed because it is too large Load diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 KiB

BIN
img/go-mqtt.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

BIN
img/growth.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

BIN
img/grwoth-old.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 KiB

BIN
img/lettuce.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

BIN
img/mole.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

BIN
img/rpc-example.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

1342
index.html

File diff suppressed because it is too large Load diff