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
# WSL Host Proxy zsh Plugin | |
# Description: 自动在 WSL 中根据宿主机网关动态设置 http_proxy 和 https_proxy | |
# Usage: | |
# 1. 将此文件放到 ~/.oh-my-zsh/custom/plugins/wsl-host-proxy/wsl-host-proxy.plugin.zsh | |
# 2. 在 ~/.zshrc 的 plugins=(...) 中添加 "wsl-host-proxy" | |
# 3. 重新加载 zsh:`source ~/.zshrc` | |
# ===== 配置 ===== | |
# 可在 ~/.zshrc 中自定义 PROXY_PORT(默认 7890) | |
: ${PROXY_PORT:=7890} |
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
#!/bin/bash | |
GITHUB_USERNAME="dongfg" | |
AUTHORIZED_KEYS_FILE="$HOME/.ssh/authorized_keys" | |
ALLOWED_KEY_TYPE="ssh-ed25519" | |
if [ ! -d "$HOME/.ssh" ]; then | |
mkdir -p "$HOME/.ssh" | |
chmod 700 "$HOME/.ssh" |
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
function Find-Command($cmdname) { | |
return [bool](Get-Command -Name $cmdname -ErrorAction SilentlyContinue) | |
} | |
# Alias | |
Set-Alias ll Get-ChildItem | |
# Git Alias | |
if (Find-Command git) { | |
function Get-GitStatus { git status } |
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
@file:Suppress("UnstableApiUsage") | |
object MavenMirror { | |
const val CENTRAL = "https://mirrors.huaweicloud.com/repository/maven/" | |
const val GOOGLE = "https://maven.aliyun.com/repository/google/" | |
const val GRADLE_PLUGIN = "https://maven.aliyun.com/repository/gradle-plugin/" | |
} | |
val mirrorMapping = listOf( | |
"https://repo1.maven.org/maven2" to MavenMirror.CENTRAL, |
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
function removeAttributes(node) { | |
if(!node.attributes) { | |
return; | |
} | |
for (var i = node.attributes.length - 1; i >= 0; i--) { | |
node.removeAttribute(node.attributes[i].name); | |
} | |
// 对于元素节点,递归处理其子节点 | |
if (node.nodeType === Node.ELEMENT_NODE) { | |
for (var child of node.childNodes) { |
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
#!/bin/sh | |
# ios ish setup | |
# wget -qO - http://10.64.60.244:9000/setup.sh | sh | |
# 文件/文本加密: | |
# echo "this is a secret." | openssl enc -e -des3 -base64 -pbkdf2 -A | |
# cat ~/.ssh/id_rsa_vps | openssl enc -e -des3 -base64 -pbkdf2 -A | |
printf "1. 更换镜像源...\n" | |
mirror=$(sed -e 's/https:\/\/\(.*\)\/alpine.*/\1/' /etc/apk/repositories | uniq) | |
newMirror="mirrors.tuna.tsinghua.edu.cn" |
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
#!/bin/sh | |
# | |
# tcpping: test response times using TCP SYN packets | |
# URL: http://www.vdberg.org/~richard/tcpping.html | |
# | |
# uses tcptraceroute from http://michael.toren.net/code/tcptraceroute/ | |
# | |
# (c) 2002-2005 Richard van den Berg <[email protected]> under the GPL | |
# http://www.gnu.org/copyleft/gpl.html | |
# |
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
@Configuration | |
class RestTemplateConfig { | |
@Bean | |
fun restTemplate(builder: RestTemplateBuilder): RestTemplate { | |
return builder.requestFactory { | |
val trustAllCerts: Array<TrustManager> = arrayOf(object : X509TrustManager { | |
override fun checkClientTrusted(chain: Array<out X509Certificate>?, authType: String?) { | |
} | |
override fun checkServerTrusted(chain: Array<out X509Certificate>?, authType: String?) { |
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" | |
"github.com/go-vgo/robotgo" | |
"strings" | |
"time" | |
) | |
func main() { |
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
// 在图标集合页面控制台执行,eg. https://www.iconfont.cn/collections/detail?cid=15699 | |
var event = new MouseEvent('click', { | |
'view': window, | |
'bubbles': true, | |
'cancelable': true | |
}); | |
var list = $("#magix_vf_main > div.wrap > div.page-collection-detail-wrap > div.collection-detail > ul").children; | |
[].forEach.call(list, function(el) { | |
el.children[2].children[0].dispatchEvent(event); | |
}); |
NewerOlder