Skip to content

Instantly share code, notes, and snippets.

@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.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
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 / 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 May 8, 2019 11:50
Socket, Channel, Selector, Asynchronous, 是否阻塞, 同步异步
@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 / android.sh
Last active October 8, 2019 08:28
android tool shell: https://termux.com
#!/system/bin/bash
# ln -s /proc/self/fd /dev/fd
# https://forum.xda-developers.com/android/software-hacking/dev-lastest-bash-android-t2898295
## mount -o remount,rw /system
# toolbox ls -la /sdcard/Download
# toybox ls -lFA /sdcard/Download
## find -path bug: https://github.com/landley/toybox/issues/73
# busybox ls -lFA /sdcard/Download
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
import subprocess
def cmp_creation(x, y):
xs = x.split("/")
ys = y.split("/")