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 / 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 / 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 / map.txt
Last active July 1, 2017 20:33
Matrix67首页
0000000000000000000000000000011111111111111111000000001000000000000000100000000101111111111111010000000010111111111111101000000001011011111111110100000000101110111111111010000000010111101111111101000000001011101111111110100000000101101110000111010000000010111111111111101000000001011111111111110100000000101111111111111010000000010000000000000001000000001111111111111111100000000000000000000000000000
0000110000111100001100000000011000111111000110000000000100011111100010000000000011001111110011000000000001111111111111100000000000001111111111000000000000000011111111000000000000000011111111110000000000001111111111111111000000000000111111111100000000000000011111111110000000000000111111111111110000000000011011111111011000000000001000111111000100000000001100000110000011000000000110000000000001100000
@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 / mysql_db_backup.sh
Last active August 29, 2015 14:00
Shell script to backup MySql database.
#!/bin/bash
# Shell script to backup MySql database.
# Usage: dbbackup db_name / dbbackup "db_name1 db_name2 db_name3"
# --------------------------------------------------------------------
MyUSER="user" # USERNAME
MyPASS="pwd" # PASSWORD
MyHOST="localhost" # HOSTNAME
# Backup Dest directory, change this if you have someother location
@aa65535
aa65535 / ip_ads.php
Last active August 29, 2015 14:00
中国IP地址段 - China Ip Addresses Range
<?php
$ip_ads = array(
array(16777472, 16778239),
array(16779264, 16781311),
array(16785408, 16793599),
array(16842752, 16843007),
array(16843264, 16859135),
array(16908288, 16909055),
array(16909312, 16910335),
array(16910592, 16941055),
@aa65535
aa65535 / aria2.bat
Last active August 9, 2024 12:08
Aria2的配置文件 & 启动脚本
:: 启动后需要保留窗口, 关闭窗口则结束进程
aria2c --conf-path=aria2.conf -D
@aa65535
aa65535 / css-filter.html
Created June 4, 2014 09:22
删除CSS中指定的选择器属性
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<textarea id="css" style="margin: 2px; width: 400px; height: 429px;"></textarea>
<textarea id="rules" style="margin: 2px; width: 400px; height: 429px;"></textarea>
<button id="submit">submit</button>
@aa65535
aa65535 / calcMask.js
Last active August 29, 2015 14:02
IP计算
function ip2long(IP) {
var i = 0;
IP = IP.match(/^([1-9]\d*|0[0-7]*|0x[\da-f]+)(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?(?:\.([1-9]\d*|0[0-7]*|0x[\da-f]+))?$/i);
if (!IP) {
return false;
}
IP[0] = 0;
for (i = 1; i < 5; i += 1) {
IP[0] += !!((IP[i] || '').length);
IP[i] = parseInt(IP[i]) || 0;
@aa65535
aa65535 / Transmission.sh
Last active August 29, 2015 14:02
Transmission CentOS安装脚本
#!/bin/bash
yum -y install gcc gcc-c++ m4 make automake libtool gettext openssl-devel pkgconfig perl-libwww-perl perl-XML-Parser curl curl-devel libevent-devel libevent libidn-devel zlib-devel
yum -y update
cd /root
wget https://downloads.sourceforge.net/project/transmissionbt/intltool-0.40.6.tar.gz
wget https://downloads.sourceforge.net/project/transmissionbt/libevent-2.0.14-stable.tar.gz
wget https://transmission.cachefly.net/transmission-2.84.tar.xz