Skip to content

Instantly share code, notes, and snippets.

View FrankFang's full-sized avatar
🎯
Focusing

Frank Fang FrankFang

🎯
Focusing
View GitHub Profile
@FrankFang
FrankFang / list.ppx
Last active April 8, 2024 12:01
list.ppx
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ProxifierProfile version="101" platform="MacOSX" product_id="2" product_minver="200">
<Options>
<Resolve>
<AutoModeDetection enabled="true"/>
<ViaProxy enabled="false">
<TryLocalDnsFirst enabled="false"/>
</ViaProxy>
<ExclusionList ExcludeSimpleHostnames="true" ExcludeLocalhost="true" ExcludeSelfHostname="true" ExcludeLocalDomain="true">localhost;%SimpleHostnames%;%ComputerName%;*.local;
</ExclusionList>
.title.show-file-icons {
display: none !important;
}
@FrankFang
FrankFang / clashx.config.yml
Last active July 21, 2023 03:55
clashX for mac
mixed-port: 7890
#---------------------------------------------------#
## 配置文件需要放置在 $HOME/.config/clash/*.yaml
allow-lan: true
mode: Rule
log-level: silent
external-controller: 127.0.0.1:60000
# 你需要在当前目录里提前准备好从其他服务商下载的 config.ymal
proxy-providers:
@FrankFang
FrankFang / clash_parsers.txt
Created July 13, 2023 05:54
clash_parsers.txt
parsers: # array
- reg: ^.*$
code: |
module.exports.parse = (raw, { yaml }) => {
const rawObj = yaml.parse(raw)
const groups = []
const rules = []
return yaml.stringify({ ...rawObj, 'proxy-groups': groups, rules })
}
yaml:
# https://www.docker.com/blog/back-up-and-share-docker-volumes-with-this-extension/
# run in host
mkdir repos
mkdir config
docker run -it -v repos:/repos -v config:/config -v "$(pwd)/repos":/outside_repos -v "$(pwd)/config":/outside_config busybox sh
# run in container
cd /repos
find . -name node_modules -type d -exec rm -rf {} \;
find . -name dist -type d -exec rm -rf {} \;
# redis server
export name=redis-server-1
mkdir -p ./$name-conf
# copy config from https://redis.io/docs/management/config-file/
vim ./$name-conf/redis.conf
docker run --network network1 -v ./$name-data:/data -v ./$name-conf:/usr/local/etc/redis --name $name -d redis redis-server /usr/local/etc/redis/redis.conf --save 60 1 --loglevel warning
# redis client
docker run -it --network network1 --rm redis redis-cli -h redis-server-1
@FrankFang
FrankFang / lambda.js
Last active January 7, 2024 15:14
λ演算
ZERO = f => x => x
ONE = f => x => f(x)
TWO = f => x => f(f(x))
THREE = f => x => f(f(f(x)))
FOUR = f => x => f(f(f(f(x))))
FIVE = f => x => f(f(f(f(f(x)))))
SIX = f => x => f(f(f(f(f(f(x))))))
SEVEN = f => x => f(f(f(f(f(f(f(x)))))))
EIGHT = f => x => f(f(f(f(f(f(f(f(x))))))))
NINE = f => x => f(f(f(f(f(f(f(f(f(x)))))))))
code --install-extension 13xforever.language-x86-64-assembly
code --install-extension 2gua.rainbow-brackets
code --install-extension alefragnani.project-manager
code --install-extension alexcvzz.vscode-sqlite
code --install-extension antfu.browse-lite
code --install-extension antfu.unocss
code --install-extension antfu.vite
code --install-extension bung87.vscode-gemfile
code --install-extension castwide.solargraph
code --install-extension christian-kohler.npm-intellisense
import * as React from 'react'
declare module 'react' {
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
flex?: boolean
relative?: boolean
text?: string
grid?: boolean
before?: string
after?: string
shadow?: boolean
{
"extends": "@antfu",
"rules": {
"curly": "off",
"arrow-parens": "off",
"@typescript-eslint/brace-style": "off",
"@typescript-eslint/consistent-type-definitions": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{