Skip to content

Instantly share code, notes, and snippets.

View xiaoxiangmoe's full-sized avatar
🐰
busy

ZHAO Jin-Xiang xiaoxiangmoe

🐰
busy
View GitHub Profile
@xiaoxiangmoe
xiaoxiangmoe / testgist.md
Last active September 11, 2017 16:07
Test Gist

Linux 学习第一天

前期准备

趁腾讯云一元学生优惠机还没有过期,我重新安装了一下腾讯云的系统,换成了CentOS 7.3

然后在Windows上把PuTTY的字体换成了be5大大的Inziu Iosevka。啊,准备好了,开搞

@xiaoxiangmoe
xiaoxiangmoe / GitHub-Forking.md
Created October 16, 2017 15:15 — forked from Chaser324/GitHub-Forking.md
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork2

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or

@xiaoxiangmoe
xiaoxiangmoe / config-overrides.js
Created November 5, 2017 10:27
react-app-rewired with css-modules and scss
/* config-overrides.js */
const rewired = require('react-app-rewired');
function contailCSSLoader(obj) {
const reg = /css-loader/;
if (typeof obj === 'string') {
return reg.test(obj);
}
@xiaoxiangmoe
xiaoxiangmoe / 前端业务代码的书写注意点.md
Last active May 8, 2018 13:49
前端业务代码的书写注意点

前端业务代码的书写注意点

变量,常量

几乎所有的 var,let,都可以用const代替,比如常见的写法:

交换两个数:

@xiaoxiangmoe
xiaoxiangmoe / react-16-6.d.ts
Last active March 14, 2022 01:58
DefinitelyTyped @types/react
import * as React from "react";
declare module "react" {
function memo<P>(
Component:React.SFC<P>,
propsAreEqual?:((
prevProps: Readonly<P & { children?: ReactNode }>,
nextProps: Readonly<P & { children?: ReactNode }>
)=>boolean
@xiaoxiangmoe
xiaoxiangmoe / genOpaqueType.js
Last active July 13, 2019 04:41
genOpaqueType
const genOpaqueType = x => "namespace _opaque{"+Array(x).fill().map((v,x)=>`declare const opaque_key_${x}:unique symbol;export interface t${x}{[opaque_key_${x}]:0}`).join(';')+"} /* prettier-ignore */ // tslint:disable-line"
// tslint:disable
interface DeepReadonlyArray<T> extends ReadonlyArray<DeepReadonly<T>> {}
type DeepReadonlyObject<T> = T extends Function
? T
: { readonly [P in keyof T]: DeepReadonly<T[P]> };
export type DeepReadonly<T> = T extends any[]
? DeepReadonlyArray<T[number]>
: T extends object
@xiaoxiangmoe
xiaoxiangmoe / t.js
Created May 18, 2020 17:28
问题:用此API打印出从1到30的十进制转十六制的对应表(最好按顺序打印)
// https://coolshell.cn/t.html
const scan = (xs, func, init) =>
xs.reduce(
(accu, curr, i, arr) => [
...accu,
func(accu[accu.length - 1], curr, i, arr),
],
[init],
);
@xiaoxiangmoe
xiaoxiangmoe / 记数学公式.md
Created April 22, 2021 09:07
记数学公式

记数学公式

[TOC]

简介

leanote的markdown编辑器支持基于MathJax编写LaTeX数学公式。

@xiaoxiangmoe
xiaoxiangmoe / lambda_cube.lean
Last active May 8, 2021 03:55
lambda_cube.lean
-- PTS-style First-order dependent types
-- usage examples
--------------------------------------------------------------------------------
-- λ→
def plus_1_of_nat : Π _ : ℕ, ℕ := λ x : ℕ, x + 1
#check plus_1_of_nat
#reduce Π _ : ℕ, ℕ