Skip to content

Instantly share code, notes, and snippets.

View rmlzy's full-sized avatar
🎯
Focusing

rmlzy rmlzy

🎯
Focusing
View GitHub Profile
@rmlzy
rmlzy / fake-reflect-metadata
Created August 5, 2021 08:17
Fake reflect-metadata
const Metadata = new WeakMap();
function defineMetadata(key, value, target) {
if (!Metadata.get(target)) {
Metadata.set(target, new Map());
}
const map = Metadata.get(target);
map.set(key, value);
}
We couldn’t find that file to show.
@rmlzy
rmlzy / README.md
Created April 12, 2019 07:04
How webpack handle CommonJS?

我们遵循 CommonJS 规范定义了一个 lib 模块, 并在 demo.js 中调用这个模块, 之后通过 webpack 的处理得到 dist/demo.js

具体步骤

首先全局安装 webpack:

sudo yarn global add webpack webpack-cli
@rmlzy
rmlzy / filter-git-author.sh
Created February 16, 2019 02:38
批量修改 Git 仓库的 commit author
#!/bin/sh
# 遍历仓库里的 commit log, 替换author
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
@rmlzy
rmlzy / README-Template.md
Created September 11, 2018 06:18 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites