Skip to content

Instantly share code, notes, and snippets.

View dongfg's full-sized avatar
🎯
Focusing

dongfg dongfg

🎯
Focusing
View GitHub Profile
@dongfg
dongfg / Microsoft.PowerShell_profile.ps1
Last active September 4, 2024 05:45
[PowerShell Profile] Save file to $PROFILE
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 }
@dongfg
dongfg / init.gradle.kts
Last active September 10, 2024 13:54
Gradle国内全局加速, 把这个文件放到~/.gradle目录下既可, tks https://gist.github.com/wuseal/76506684c63c5399150d9fd671cbc89b
@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/"
}
@dongfg
dongfg / run.js
Created January 23, 2024 05:36
墨刀 modao.cc 画布目录获取,打开控制台执行
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) {
@dongfg
dongfg / ish.sh
Last active April 3, 2023 08:10
iOS iSH init
#!/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"
#!/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
#
@dongfg
dongfg / RestTemplateConfig.kt
Created February 26, 2020 07:59
kotlin spring restTemplate okHttp ignore ssl
@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?) {
@dongfg
dongfg / main.go
Created November 7, 2019 06:56
淘宝自动删除订单
package main
import (
"fmt"
"github.com/go-vgo/robotgo"
"strings"
"time"
)
func main() {
@dongfg
dongfg / script.js
Created July 23, 2019 01:53
iconfont 批量添加购物车
// 在图标集合页面控制台执行,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);
});
@dongfg
dongfg / build.sh
Created January 18, 2019 05:48
delete blank lines of hexo generate html
# 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' {} +
@dongfg
dongfg / xxf-v.zsh-theme
Last active June 16, 2021 11:01
zsh xxf custom theme
# 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
}