Skip to content

Instantly share code, notes, and snippets.

View dongfg's full-sized avatar
🎯
Focusing

dongfg dongfg

🎯
Focusing
View GitHub Profile
@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"
@dongfg
dongfg / main.go
Last active September 19, 2021 12:21
腾讯云 CloudBase Open API 参考 - 函数调用 + 数据库操作
package main
import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"fmt"
"io/ioutil"
"log"
#!/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 <richard@vdberg.org> under the GPL
# http://www.gnu.org/copyleft/gpl.html
#
@dongfg
dongfg / InstallNET.sh
Last active May 8, 2021 05:09
MoeClub InstallNET.sh, add ubuntu 20 support
#!/bin/bash
## License: GPL
## It can reinstall Debian, Ubuntu, CentOS system with network.
## Default root password: MoeClub.org
## Blog: https://moeclub.org
## Written By MoeClub.org
export tmpVER=''
@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
}