| language | line | count | avg | repo | query |
|---|---|---|---|---|---|
| Go | 1580380 | 690 | 2290 | https://github.com/golang/go.git | rg -c -t go '^type.+interface {' | cut -d: -f2 | awk '{sum += $1}; END {print sum}' |
| Java | 5370734 | 7269 | 739 | https://github.com/openjdk/jdk.git | rg -c -t java 'interface .+{$' |
| Rust | 895020 | 3495 | 256 | https://github.com/rust-lang/rust | rg -c -t rust 'trait .+{$' |
| TypeScript | 1461415 | 7376 | 198 | https://github.com/microsoft/TypeScript.git | rg -c -t ts 'interface .+{$' |
This file contains hidden or 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
| 一个纯函数,输出只取决于输入 | |
| 使用最简单的情况举例,一个递归函数只存在一个递归调用 | |
| 该递归调用讲函数分成三个部分, | |
| 1. 递归基 + 准备部分 | |
| 2. 递归调用部分 | |
| 3. 递归调用之后的部分 | |
| 其中第一部分的 准备部分 可以影响递归调用的参数值 | |
| 第三可以使用递归返回的值(写的时候可以认为这个值来自未来,或者有些更简单的情况,明显能感受到它就是从后往前在处理) |
This file contains hidden or 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
| # CPS + 高阶函数可以将递归改写成尾调用,使用Trampoline即可避免爆栈 | |
| def cpsF(x,count): | |
| if x == 0: | |
| count(1) | |
| else: | |
| cpsF(x-1,lambda y:count(x*y)) | |
| cpsF(257,print) |
This file contains hidden or 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
| # var a = new Array() | |
| # document.querySelectorAll('.text-ellipsis').forEach(items=>{a.push(items.title)}) | |
| # console.log(a.join('\n')) | |
| # git clone https://github.com/intellij-rust/intellij-rust --depth=1 || true | |
| # ... | |
| # ls -1 | xargs -I{} scc -f json {} | jq '.[] | select(.Name == "Kotlin") | .Code' | pbcopy | |
| # ls -1 | pbcopy |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "strconv" | |
| "strings" | |
| ) |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| "os/exec" | |
| "runtime" | |
| "github.com/go-vgo/robotgo" |
This file contains hidden or 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 lang="en"> | |
| <head> | |
| <title>Document</title> | |
| <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script> | |
| <script src="https://unpkg.com/react@17/umd/react.development.js" crossorigin></script> | |
| <script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js" crossorigin></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js" referrerpolicy="no-referrer"></script> | |
| <script src="https://cdnjs.cloudflare.com/ajax/libs/antd/4.17.0-alpha.3/antd.min.js" integrity="sha512-EvRn+ZDd7rBIodR8NJL+HrBvocKo2JIEkTURw3FFc2RdCDa68cqGDEgpCeE4fVM3SEeY06oO7T7xHxG/tb4hKw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/antd/4.17.0-alpha.3/antd.min.css" integrity="sha512-7FnaoVW3bqm5s1R5RRW/rUkIWBXv8HNRIAvLJiw90aiyAVn2Ma9T3D1TR4zSQAkV154ItnMT1Q/5i6jBWXKAbQ==" crossorigin="anonymous" referrerpolicy="no-referrer" /> |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "os" | |
| ) | |
| func checkBOM(filepath string) bool { | |
| file, err := os.Open(filepath) |
This file contains hidden or 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
| #include <Python.h> | |
| static PyObject * fibonacci_fib(PyObject *self, PyObject *args) { | |
| int n; | |
| if (!PyArg_ParseTuple(args, "i", &n)) { | |
| return NULL; | |
| } | |
| int i; | |
| int a = 0; | |
| int b = 1; |
- create a file /etc/init.d/clash
#!/sbin/openrc-run
command="/root/clash-linux-amd64-v3-2022.11.25"
command_args="-f /root/config.yaml"
depend() {
need net
after firewall