Skip to content

Instantly share code, notes, and snippets.

View willin's full-sized avatar
🌈
关注我老王带你躺平养老

Willin 老王退休啦 willin

🌈
关注我老王带你躺平养老
View GitHub Profile
@willin
willin / .eslintrc.yml
Created November 25, 2021 08:09
ESLint Config of Mix Typescript and Javascript Project
{
"env": { "browser": true, "es6": true, "node": true },
"extends": ["eslint:recommended", "plugin:react/recommended"],
"globals": { "Atomics": "readonly", "SharedArrayBuffer": "readonly" },
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": { "jsx": true },
"ecmaVersion": 2018,
"sourceType": "module"
},
@willin
willin / keybase.md
Created August 4, 2021 10:07
keybase.md

Keybase proof

I hereby claim:

  • I am willin on github.
  • I am willin (https://keybase.io/willin) on keybase.
  • I have a public key ASDBHt5gTYHwofsS3Iw26GVOO70t_iA32EAeUr4pjkEopwo

To claim this, I am signing this object:

@willin
willin / gist:8bc65cacfc15e3ca6102790b9b36937f
Last active October 5, 2020 21:10
📊 Weekly development breakdown
We couldn’t find that file to show.
@willin
willin / ⏰ Daily Productivity Stats - 2020-10-29
Last active October 29, 2020 16:01
⏰ Daily Productivity Stats
⏰ Stats for October 29th 2020
Productivity Pulse 53m 26s ██████▋░░░ 67%
All Productive 38m 6s ███████▏░░ 71%
All Distracting no time ░░░░░░░░░░ 0%
Neutral 15m 20s ██▊░░░░░░░ 29%
@willin
willin / proxy.d.ts
Last active December 12, 2019 02:24
proxy.d.ts
//定义proxy中必须实现的handler参数接口
interface ProxeeHandler<T extends object, TOut extends object> {
get?<K extends keyof TOut>(target: T, p: K, receiver: TOut): TOut[K];
set?<K extends keyof TOut>(target: T, p: K, value: TOut[K], receiver: TOut): boolean;
}
//定义proxy的构造函数接口
interface ProxeeConstructor {
new <T extends object, TOut extends object>(target: T, handler: ProxeeHandler<T, TOut>): TOut;
}
//用以上两个接口声明一个Proxee,其用法和Proxy一模一样
@willin
willin / Github.graphql
Last active April 26, 2018 09:44
Github GraphQL API
{
user(login: "willin") {
followers {
totalCount
}
repositories {
totalCount
}
repositoriesContributedTo {
totalCount
var getStrength = function (passwd) {
'use strict';
var intScore = 0;
if (passwd.match(/[a-z]/)) // [验证]至少一个小写字母
{
intScore = (intScore + 1);
}
if (passwd.match(/[A-Z]/)) // [验证]至少一个大写字母
{
intScore = (intScore + 5);