Skip to content

Instantly share code, notes, and snippets.

@gMan1990
gMan1990 / main.js
Created September 8, 2018 07:59
杭州驾考初学体验预约筛选
// URL: http://syjy.5u5u5u5u.com/syjy/reserve/toLessonReservePage_xianxietiyan.htm
// 步骤: 一步步拷贝执行
// 1. get map
jQuery(function ($) {
window._resultMap = {};
$('#areaSwitch>li').each(function (i, v) {
var areaId = $(v).attr('areaid');
$.get('http://syjy.5u5u5u5u.com/syjy/reserve/queryExperienceLessonReserveData.htm', {
areaId: areaId
@gMan1990
gMan1990 / main.java
Created September 8, 2018 16:24
[Index of /]页面递归搜索文件
/**
* @param url
* endsWith("/")
* @param str
* searchStr
*/
private static void search(String url, String str) {
try {
Document doc = Jsoup.connect(url).get();
Elements elements = doc.select("pre > a");
@gMan1990
gMan1990 / main.md
Last active June 1, 2023 15:05
Cygwin/MSYS2/Mintty 中文乱码问题解决方案

自己挑一种即可~

  • 【推荐】新开gbk窗口执行你的命令:
mintty -o Locale=zh_CN -o Charset=GBK -e fish &
# -e是打开后执行命令,这里的fish是一个shell,你没用就去掉
  • 执行chcp然后再执行你的命令(会改变输出信息的语言)
@gMan1990
gMan1990 / main.sh
Last active October 28, 2018 07:01
递归列出jar文件内容便于查找Class
#!/bin/bash
# usage: bash this.sh path
# $1: path, parsed
jarList() {
path=$1
if [ -d "$path" ]; then
cd "$path" || exit #https://github.com/koalaman/shellcheck/wiki/SC2045
for sub in *; do
if [ "/" = "$1" ]; then
@gMan1990
gMan1990 / main.sh
Last active October 28, 2018 08:50
文件按行数分割,且限制文件大小(非完美解决方案)
#!/bin/bash
# usage: bash this.sh lines lineBytes file toDir
lines=$1
lineBytes=$2
file=$3
toDir=$4
if [ "Darwin" = "$(uname)" ]; then
# MacOS: brew install coreutils
@gMan1990
gMan1990 / main.md
Last active August 21, 2020 06:49
JDK(Java Development Kit) 绿色版,MacOS,Windows
@gMan1990
gMan1990 / Main.java
Last active December 26, 2018 18:18
获取github repo与它的forks的每个分支的最后提交时间
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.commons.lang3.StringUtils;
import org.jsoup.Jsoup;
@gMan1990
gMan1990 / _man.fish
Last active September 22, 2019 05:56
$cmd --help; man "$cmd"|col -b
# https://fishshell.com/docs/current/tutorial.html#tut_autoload
function _man
if type "$argv[1]" >/dev/null
if type "$argv[1]" | grep -m 1 " is a function with definition\$" >/dev/null
type "$argv[1]" >&2
else
if test "nginx" = "$argv[1]"
"$argv[1]" -h 2>&1; echo -e "\n"
else if test "echo" != "$argv[1]"
"$argv[1]" --help 2>&1; echo -e "\n"
@gMan1990
gMan1990 / main.sh
Last active May 12, 2022 11:42
ffmpeg ysl to a live
#!/bin/bash
cd "$(dirname "$0")" || exit 1
DIR=$(pwd)
OUTFILE="-f flv rtmp://js.live-send.acg.tv/live-js/?streamname=*&key=*"
while :; do
#./ffmpeg -re -i "Bailey No Ordinary Cat.mp4" -c copy $OUTFILE
cd "$DIR/YSL" || exit 1
for name1 in *; do
jQuery(function ($) {
    var result = new Map(),
    processor = function (ele) {
        $("div.sms-number-list.row", ele).each(function (i, e) {
            var key = e.querySelector("div>a").href,
            val = result.get(key),
            text = $.text(e.querySelector("div>h3"));
            if (val) {
                val.push(text);