git status --porcelain # 是否干净
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
##################################### | |
#Author: Leon Lee # | |
#email: lendylongli@gmail.com # | |
#QQ: 730395591 # | |
#Version: 1.0 # | |
#Note: If you have some good ideas # | |
# or advice, please mail me^^ # | |
##################################### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
#default-example { | |
height: 300px; | |
width: 300px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }; | |
type XOR<T, U> = (T | U) extends object ? (Without<T, U> & U) | (Without<U, T> & T) : T | U; | |
type NameOnly = { is: "NameOnly", name: string }; | |
type FirstAndLastName = { is: "FirstAndLastName", firstname: string; lastname: string }; | |
type Person = XOR<NameOnly, FirstAndLastName>; | |
let person: Person; | |
person = { is: "NameOnly", name: "Foo" }; | |
person = { is: "FirstAndLastName", firstname: "Foo", lastname: "Bar" }; |
总结 infer 在被extends判断的条件子语句中定义,返回语句中使用
// 基本extends
/**
* @example
* type A1 = 1
wget -qO- bench.sh | bash
#或者
curl -Lso- bench.sh | bash
#或者
wget -qO- 86.re/bench.sh | bash
#或者
curl -so- 86.re/bench.sh | bash
OlderNewer