Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

一波不是一波 riskers

🎯
Focusing
View GitHub Profile
@riskers
riskers / .dockerignore
Last active Mar 17, 2020
Docker 化 eggjs 应用 + gitlab CI
View .dockerignore
app/**/*.js
test/**/*.js
config/**/*.js
app/**/*.map
test/**/*.map
config/**/*.map
@riskers
riskers / rxjs-diagrams.md
Created Dec 14, 2018 — forked from PCreations/rxjs-diagrams.md
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@riskers
riskers / main.md
Last active Oct 14, 2019
关于 websocket 心跳的一些记录
View main.md

长连接为什么要保持心跳?

websocket心跳是为了让 client 告诉 server 『我还活着,没有掉线』而存在的,否则 server 可能会断掉连接。

国内移动无线网络运营商在链路上一段时间内没有数据通讯后, 会淘汰NAT表中的对应项, 造成链路中断。而国内的运营商一般NAT超时的时间为5分钟,所以通常我们心跳设置的时间间隔为3-5分钟。

一般是 client send ping ,server 返回 pong 保持心跳。

var heartCheck = {
@riskers
riskers / main.md
Created Sep 26, 2018
wordpress 开发
View main.md
| - your-theme
  | - images              # 主题相关图片资源
  | - header.php          # html 头部模板
  | - footer.php          # html 尾部模板
  | - index.php           # 首页模板
  | - single.php          # 文章模板
  | - page.php            # 页面模板
  | - style.css           
@riskers
riskers / README.md
Last active Sep 27, 2018
wxapp 踩坑日志
View README.md
  1. tabBarselectedIconPath 必须设置,否则:

尺寸最好为 81 * 81

  1. navigationStyle: "custom" 时可以自定义导航栏,然后如果需要设置返回键,需要设置 topstatusBarHeight + 10:

10 是经验值,是指胶囊键据屏幕上边缘的距离

@riskers
riskers / README.md
Created Jun 20, 2018
react router 获取 query params
View README.md
<Router>
  <div className="router-container">
    <Route exact path="/" component={ Home } />
    <Route exact path="/search" component={ Search } />
  </div>
</Router>

比如现在搜索要搜 t: texts: abc,路由应该是 /search?t=text&s=abc

View default.custom.yaml
# Rime default settings
# encoding: utf-8
patch:
config_version: "0.38"
schema_list:
# - schema: luna_pinyin
- schema: luna_pinyin_simp
# - schema: luna_pinyin_fluency
# - schema: bopomofo
@riskers
riskers / injectReducer.js
Last active Mar 6, 2018
react-router inject store
View injectReducer.js
import { combineReducers } from 'redux';
import globalDate from 'reducers/globalDate'
import permission from 'reducers/permission'
const createReducer = function (reducers) {
return combineReducers({
/* 公共 reducers,无论一开始在哪个路由下,都会载入 */
globalDate,
@riskers
riskers / immutablejs.md
Last active Apr 23, 2019
reselect 和 immutablejs 学习说明
View immutablejs.md

在 reducer 中,都是返回一个新对象,否则组件是不会更新 ui 的。而返回新对象,可以:

  • Object.assign:比较 hack,每次新生成一个对象
  • ...state
  • immutable.js
You can’t perform that action at this time.