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
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 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 AliYunMaven { | |
const val CENTRAL = "https://maven.aliyun.com/repository/central/" | |
const val JCENTER = "https://maven.aliyun.com/repository/jcenter/" | |
const val GOOGLE = "https://maven.aliyun.com/repository/google/" | |
const val GRADLE_PLUGIN = "https://maven.aliyun.com/repository/gradle-plugin/" | |
const val APACHE_SNAPSHOTS = "https://maven.aliyun.com/repository/apache-snapshots/" | |
} |
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
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 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 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 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 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 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); | |
}); |
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
# execute after hexo g; | |
# if you are use macos, use gsed instead sed(brew install gnu-sed); | |
find public -type f -name *.html -exec sed -i '/^[[:space:]]*$/d' {} + |
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
# Copy and self modified from xxf | |
# Machine name. | |
function box_name { | |
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST | |
} | |
function exists { | |
command -v $1 >/dev/null 2>&1 | |
} |
NewerOlder