Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active November 17, 2024 01:08
The introduction to Reactive Programming you've been missing
@rowanmanning
rowanmanning / README.md
Last active February 18, 2024 21:12
Writing a Friendly README. This a companion-gist to the post: http://rowanmanning.com/posts/writing-a-friendly-readme/
@aNd1coder
aNd1coder / mongodb_create_database_and_user.sh
Last active October 18, 2016 02:30
Mongodb create database and user
> use admin
> db.createUser({user: 'root',pwd: '123456',roles: ['root']})
> db.auth('root','123456')
> use page_factory
> db.createUser({user: 'user',pwd: '123456',roles: [{role: 'readWrite', db: 'dbName'}]})
> db.auth('user','123456')
@kaiye
kaiye / my.sh
Last active October 18, 2016 02:20
常用 Linux 命令行
# 网络
# 查看本地公网 IP
curl ifconfig.me
dig 1024.io
dig -x 104.155.233.156
# 并发测试
ab -n 1000 -c 1000 http://www.meizu.com/
# 全站抓取
wget -r -p -np -k http://www.meizu.com/es/
@lichenbuliren
lichenbuliren / create-reducer-action-types
Created September 14, 2021 02:06
dynamic create reducer actions by enum action type
type CreateActionMap<M extends { [index: string]: any }> = {
// 通过 extends undefined 来判断是否有 payload 要求
[Key in keyof M]: M[Key] extends undefined
? {
type: Key;
}
: {
type: Key;
payload: M[Key];
};