Skip to content

Instantly share code, notes, and snippets.

View FairyScript's full-sized avatar
🌙

FairyScript FairyScript

🌙
View GitHub Profile
@FairyScript
FairyScript / typescript subtype.md
Last active September 1, 2023 08:47
typescript get subtype in union type by prop
type Type = 'a' | 'b'

interface Base {
  type: Type
  data: {}
}

interface A extends Base {
 type: 'a'
const injectJsx: JsPlugin = {
name: 'inject-jsx',
transform: {
filters: {
moduleTypes: ['tsx', 'jsx'],
},
executor: async (param) => ({
content: `import React from 'react';\n${param.content}`,
}),
},
# Add IP blacklist which you want to filtering from some DNS server here.
# The example below filtering ip from the result of DNS server which is configured with -blacklist-ip.
# blacklist-ip [ip/subnet]
# blacklist-ip 254.0.0.1/16
blacklist-ip 4.36.66.178
blacklist-ip 8.7.198.45
blacklist-ip 31.13.64.1
blacklist-ip 31.13.64.33
blacklist-ip 31.13.64.49
blacklist-ip 31.13.65.1
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGHgYvkBEACXXcTw2hUVWU3iSmlUactcSXE+UfCSxeGITuycjJK7gUNaclOG
1ppjqbksMdzNhDenBRBhQ7emMSgaG1q06OmsquKWf9R6oXjxR8lrcBccdgqXYHKA
OqH2kVP9Jjc3JhSMND6/rS7m4bnjm/TMyneo9+st9WHfkyiQ3zYspoPw3lCIuCoS
5yqfSFA22N2PvVGTKlORP9PrUfgHyDDLbzilPmKR7E+ZrZlTq1spGOgLxO/URm1Z
HjisGbTzK8i72pVXK3OgSvjw9zTRf3t3ujIvMbcN8cjwV7T/MD4mOwhqXqeOkCUt
GNRQCkj3JtvAFeMGpHkgjKFLpxAQGnwHVydPU4lNWWqOMQlToHADjPLoNQTBSjTB
rQJW2CoDzZGkesKeOmbnzmtv3XkrbW3EW7Ryo35Orflfolgqs/fkhwOqYujzbBTy
T2rYE3CpHtrLdV4ntMlCSsz70EuqhmV/aYLTTGH2Znoo6xMR9o8rnYQeylT2A5Xn
@FairyScript
FairyScript / linux-http-tcp.md
Created October 20, 2019 10:47 — forked from v5tech/linux-http-tcp.md
linux下查看http 并发和 tcp连接数

linux查看httpd进程数

ps -ef | grep httpd | wc -l

查看Apache的并发请求数及其TCP连接状态

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
@FairyScript
FairyScript / adnmb_redir.js
Last active March 8, 2019 15:58
adnmb.com https跳转&重定向首页至时间线
//需配合 Owl Redirector 或其他的重定向工具使用
//Filter: /^http(s)?:\/\/adnmb.?\.com/
url =>{
var parser = document.createElement('a');
parser.href = url;
if(parser.protocol === 'http:'){parser.protocol = 'https:';}
if(parser.pathname === '/Forum' || parser.pathname === '/'){parser.pathname = '/f/时间线';}
return parser.href;
}