Skip to content

Instantly share code, notes, and snippets.

View aa65535's full-sized avatar
💭
I may be slow to respond.

Jian Chang aa65535

💭
I may be slow to respond.
View GitHub Profile
@aa65535
aa65535 / TestCalendar.java
Last active September 21, 2015 14:30
Print formatted calendar
package calendar;
public class TestCalendar {
public static void main(String[] args) {
ViewCalendar vc = new ViewCalendar(2015);
vc.print();
// vc.print(9);
}
}
@aa65535
aa65535 / Node.prototype.js
Last active December 31, 2015 11:49
仿jQuery的DOM操作方法,只有基本的操作。
// 所有方法都在最后返回当前元素(包括appendTo和prependTo)
// 可以使用链式写法
// append方法 向匹配的元素内部追加内容
// 参数可以是字符串或者是使用createElement()方法创建的DOM对象
Node.prototype.append = function(ele) {
if (typeof ele === 'string') {
var t = document.createElement('div');
t.innerHTML = ele;
while (t.firstChild) {
@aa65535
aa65535 / AdmX.bat
Last active November 18, 2016 17:37
一个使用Aria2下载迅雷离线的批处理, 使用前需要将BAT文件编码改为ANSI
:: AdmX - Aria2 Download Manager for Xunlei
:: Release by aa65535
:: Time: 2013-12-13 03:08:57
:: External Command: aria2c.exe, wfr.exe
@echo off
title Aria2& color f3& mode con: cols=80 lines=8& setlocal enabledelayedexpansion
:: 检查Aria2是否可用
aria2c& cls
if !errorlevel! gtr 1 echo aria2c.exe not found!& pause>nul& exit
@aa65535
aa65535 / map.txt
Last active July 1, 2017 20:33
Matrix67首页
0000000000000000000000000000011111111111111111000000001000000000000000100000000101111111111111010000000010111111111111101000000001011011111111110100000000101110111111111010000000010111101111111101000000001011101111111110100000000101101110000111010000000010111111111111101000000001011111111111110100000000101111111111111010000000010000000000000001000000001111111111111111100000000000000000000000000000
0000110000111100001100000000011000111111000110000000000100011111100010000000000011001111110011000000000001111111111111100000000000001111111111000000000000000011111111000000000000000011111111110000000000001111111111111111000000000000111111111100000000000000011111111110000000000000111111111111110000000000011011111111011000000000001000111111000100000000001100000110000011000000000110000000000001100000
#!/bin/sh
CD_VER="1.1.8"
CD_SHA="324844f"
CD_RLS="1"
SS_VER="1.5.3"
SS_SHA="5cc562f"
SS_RLS="1"
SV_VER="0.1.4"
SV_SHA="0d51fd3"
@aa65535
aa65535 / README.md
Last active June 23, 2018 16:04
OpenWrt ShadowSocks Traffic Redirection Rules

ss-rules

使用 ipset -R OR iptables-restore 添加规则

优先使用 ipset, 其在流量转发时匹配效率相对 iptables 要高

测试 ss-rulesignore.list 包含 4747 条 IP 的执行用时:

# time /usr/bin/ss-rules -c $CONFIG -i $IGNORE
@aa65535
aa65535 / lftp.sh
Created July 21, 2014 03:45
lftp同步脚本
#!/bin/bash
HOST="123.123.123:21" # FTP服务器地址
USER="username" # FTP用户名
PASS="password" # FTP密码
SCD="/" # 远程根目录
LCD="/home/www/" # 本地根目录
LST="dir1 dir2 dir3" # 要同步的目录, 空格隔开
for RCD in $LST; do
@aa65535
aa65535 / localParam.js
Last active June 8, 2020 10:10
jQuery ajax在GBK编码下的解决方案
(function ($) {
// 根据当前页面编码进行URL编码
$.urlEncode = function(s) {
var a, u;
a = document.createElement('a');
a.href = '/?_=' + s;
u = a.href.slice(a.href.indexOf('/?_=') + 4);
return encodeURIComponent(u).replace(/%25([0-9A-F]{2})/gi, '%$1');
};
// 添加 localParam 方法 URL编码使用 $.urlEncode
@aa65535
aa65535 / dnsmasq.conf
Last active December 24, 2022 07:12
dnsmasq config
# 并发查询所有上游DNS服务器
all-servers
# 本地DNS缓存最小有效期
min-cache-ttl=3600
# 本地DNS缓存数目
cache-size=65535
# 上游DNS服务器, 可设置多个
server=8.8.4.4
#server=8.8.8.8
server=114.114.114.114
@aa65535
aa65535 / aria2.bat
Last active February 7, 2024 05:41
Aria2的配置文件 & 启动脚本
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D