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
// ==UserScript== | |
// @name 京东只看自营 | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description 只看京东自营产品 | |
// @author Chopin Ngo <consatan@gmail.com> | |
// @match https://list.jd.com/list.html* | |
// @grant none | |
// ==/UserScript== |
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
<?php | |
/** | |
* 转换数组为 SimpleXMLElement | |
* | |
* 数组键名转换为 nodeName(value为数组时) 或 attributeName(value非array时) | |
* 数组键名为 _ 时转换为 innerText | |
* | |
* 数组值转换为 nodeValue或attribute | |
* 数组值为数组时转换为子节点 | |
* 数组值为 null 时转换为空节点 |
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
// php strtr 函数的 js 实现 v.a. https://www.php.net/manual/en/function.strtr.php | |
// 只实现了 strtr(string $str, array $replace_pairs) 这种调用方法,且 replace_pairs 里只能是单个字符替换为单个字符 | |
// 目的是为了做凯撒密码实现 | |
String.prototype.strtr = function(dic) { | |
return this.toString().split('').map(char => dic[char] || char).join(''); | |
} | |
// 调用 | |
let str = '123321123'; |
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
<?php | |
// redis lua script use LRANGE and LTRIM | |
// redis-cli SCRIPT LOAD "local res; res = redis.call('LRANGE', KEYS[1], 0, ARGV[1] - 1); redis.call('LTRIM', KEYS[1], ARGV[1], -1); return res" | |
// script sha1: 163b2d3e271c4b0ca837426d9c0fffd9fc5bf591 | |
// redis lua script use LPOP loop | |
// SCRIPT LOAD "local res = {}; for i=ARGV[1],1,-1 do table.insert(res, redis.call('LPOP', KEYS[1])); end; return res" | |
// script sha1: 015204a29f59eca28a9079f0246ec9a25871b031 | |
// Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz 3.19 1x16G 2666MHz |
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
WSL2 vhd location | |
C:\Users\{USERNAME}\AppData\Local\Packages\{DISTRO}\LocalState\{DISTRO_PACKAGE_NAME}\ext4.vhdx | |
Docker for Windows vhd location | |
C:\Users\{USERNAME}\AppData\Local\Docker\wsl\data\ext4.vhdx | |
# delete unuse volume | |
docker volume prune | |
exit docker for windows (Right-clicking the whale icon in the notification area (bottom right) > Quit Docker Desktop) |
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/bash | |
# v.a. https://unix.stackexchange.com/a/257966 | |
# -daystart -mtime +0 表示文件的 mtime 时间在当天 0 点前(用于保留最新的一个文件) | |
# 如果没有 -daystart 的话,表示 文件的 mtime 时间在 24 小时前(用于保留最新的2个文件) | |
find ./ -maxdepth 1 -type f -name '*.log' -daystart -mtime +0 -exec gzip {} \; |
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
docker image history --no-trunc --format '{{.CreatedBy}}' IMAGE_NAME:TAG | tac |
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 ( | |
"regexp" | |
"os" | |
"os/exec" | |
) | |
var pattern = regexp.MustCompile(`(?m)^Path = (.+)$`) |
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
https://bpjc.xyz/api/v1/client/subscribe?token=2116e2631f6dff0926594b6ff6ec64a5&flag=shadowrocket | |
https://paste.gg/p/anonymous/4297d3372dcf4f4ea11b351e27b9e801/files/f5763822b2304577a2665aa98619f812/raw | |
https://suo.yt/ZF2DaFO | |
https://www.gyy.pw/api/v1/client/subscribe?token=c591df25ee623806fb752d1943c8dfA2 | |
https://xn--mesv7f5toqlp.club/api/v1/client/subscribe?token=54f417aecc83d39e0a2f362779376eb5 | |
https://suo.yt/E2xzY8f | |
https://subscribe.arapi.top/api/v1/client/subscribe?token=aed89f63c84d291145e55d3972db6be2 | |
https://dy.72img.xyz/api/v1/client/subscribe?token=a268a7bfc948a09f87a1d94a525717df | |
https://paste.centos.org/view/raw/2182ec4d | |
https://www.rerongtuliao.com/api/v1/client/subscribe?token=091112454770a3d7c84adec11be973ef |
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
<!DOCTYPE html> | |
<html lang="en-us"> | |
<head> | |
<style> | |
html, body { | |
width: 100%; | |
height: 100%; | |
} | |
.loading div { |