Skip to content

Instantly share code, notes, and snippets.

View 5idu's full-sized avatar
🎯
Focusing

5idu

🎯
Focusing
View GitHub Profile
@5idu
5idu / Vue指令
Created June 26, 2018 10:22
vue.js常用指令
- v-bind
- v-if
- v-for
- v-on
- v-model
待更新...
@5idu
5idu / Exploration of coding ideas
Created June 28, 2018 09:05
code style design
### DRY原则(Don't Repeat Yourself)
* 最初级的DRY:语法级别
* before
```java
System.out.println(1);
System.out.println(2);
……
System.out.println(10);
```
* after
@5idu
5idu / Require skills
Created June 28, 2018 09:07
some require skills
## Require Skills
- JavaScript/ES6/ES7
- Node.js内部核心模块及标准库
- MongoDB,MySql
- Redis
- Nginx
- Socket.io
- 熟悉TCP/IP,UDP,HTTP,HTTPS,WebSocket,XMPP等网络通讯协议
- MQTT协议,WebRTC协议
- Restful Api
@5idu
5idu / Just for fun
Created June 28, 2018 09:09
some fun things
```js
console.log([
" _ooOoo_",
" o8888888o",
" 88\" . \"88",
" (| -_- |)",
" O\\ = /O",
" ____/`---'\\____",
" .' \\\\| |// `.",
" / \\\\||| : |||// \\",
@5idu
5idu / Docker
Last active June 29, 2018 03:29
docker knowledges
```bash
docker version(`-v`)
docker info
docker build -t friendlyhello . # Create image using this directory's Dockerfile
docker run -p 4000:80 friendlyhello # Run "friendlyname" mapping port 4000 to 80
docker run -d -p 4000:80 friendlyhello # Same thing, but in detached mode
docker container ls # List all running containers
docker container ls -a # List all containers, even those not running
docker container stop <hash> # Gracefully stop the specified container
docker container kill <hash> # Force shutdown of the specified container
@5idu
5idu / Socket.io
Last active July 12, 2018 02:47
explorer socket.io
- [socket.io搭建聊天室](https://www.jianshu.com/p/51b0d1f80392)
@5idu
5idu / MongoDB
Created July 18, 2018 07:13
mongodb knowledges
## $type
| Double |1|
|-|-|
| String |2|
| Object |3|
| Array |4|
|Binary data|5|
| Undefined |6|
|Object id|7|
| Boolean |8|
@5idu
5idu / koa.js
Created July 24, 2018 04:08
使用koa框架开发时,需要的一些知识点
### 使用Koa.js,离不开这十个中间件
- [koa-router](https://github.com/alexmingoia/koa-router)
- [koa-bodyparser](https://github.com/koajs/bodyparser)
- [koa-views](https://github.com/queckezz/koa-views)
- [koa-static](https://github.com/koajs/static)
- [koa-session](https://github.com/koajs/session)
- [koa-jwt](https://github.com/koajs/jwt)
- [koa-helmet](https://github.com/venables/koa-helmet)
- [koa-compress](https://github.com/koajs/compress)
- [koa-logger](https://github.com/koajs/logger)
@5idu
5idu / 解决: npm install failed
Created July 30, 2018 06:55
when npm install gitlab's repo, docker build failed.
### docker build failed when npm install from gitlab repo
#### 问题一:git 命令找不到
- 解决:`apk add git`,在镜像中安装git
#### 问题二:git pull repo 时提示无权限
- 解决:package.json中包链接修改成:`git+https://[username]:[password]@lab.qingteng.info/be/qingniu-lib.git`
#### 问题三:显式的将gitlab用户名密码暴露出来不安全
- 解决:使用repo tokent替代用户名密码pull repo,`settings -> Repository -> Deploy Tokens`,创建好token之后,使用token代替用户名密码pull repo
@5idu
5idu / web framework
Created September 6, 2018 16:43
rankings
- Meteor: 40235
- Express: 40032
- Next: 28761
- Koa: 22921
- Nuxt: 14578
- Loopback: 11590
- Hapi: 9935
- egg: 9779
- Feathers: 9623
- Restify: 8594