Skip to content

Instantly share code, notes, and snippets.

View Aqours's full-sized avatar
👻
~Let's go~

L&H Aqours

👻
~Let's go~
View GitHub Profile
@Aqours
Aqours / create_swap_asuswrt.sh
Last active April 14, 2024 16:07
Creating Swap File for AsusWrt(RT-AC86U)
# @see https://www.snbforums.com/threads/add-swap-to-usb-drive-on-asus-router.46911/
# Run the command `df` to see where your USB drive is mounted.
# Should be something like /tmp/mnt/volume-label
# Of course use your volume label in the following commands.
#--------------------------------------------
# Create a swap file
#--------------------------------------------
dd if=/dev/zero of=/tmp/mnt/volume-label/myswap.swp bs=1k count=524288
mkswap /tmp/mnt/volume-label/myswap.swp
@Aqours
Aqours / bash_proxy_function.sh
Created November 2, 2019 01:01
bash_proxy_function.sh
# configure proxy for git while on corporate network
# From https://gist.github.com/garystafford/8196920
function proxy_on(){
# assumes $USERDOMAIN, $USERNAME, $USERDNSDOMAIN
# are existing Windows system-level environment variables
# assumes $PASSWORD, $PROXY_SERVER, $PROXY_PORT
# are existing Windows current user-level environment variables (your user)
local GENERAL_PROXY="socks5://127.0.0.1:1081"
@Aqours
Aqours / parseHTML.js
Created November 7, 2017 12:18
解析文档字符串
/**
* 解析文档字符串
*
* @param {string} html
* @returns {DocumentFragment}
*/
function parseHTML(html) {
const parser = new DOMParser();
const context = parser.parseFromString(html, "text/html");
const children = context.body.children;
@Aqours
Aqours / shuffle.js
Created November 7, 2017 12:17
随机打乱数组
/**
* @param {Array} list
* @return {Array}
*/
function shuffle(list) {
var len = list.length;
var randomIndex, buffer;
while (len) {
randomIndex = Math.floor(Math.random() * len);
buffer = list[--len];
@Aqours
Aqours / scroll_roller.js
Created June 4, 2017 01:23
ScrollRoller
/**
* @param {Object} [option]
* @param {HTMLElement} [option.element]
* @param {String} [option.axis = "y"] --- "x" || "y" || "xy"
* @param {Number} [option.pageX = 0]
* @param {Number} [option.pageY = 0]
* @param {Number} [option.acceleration = 0.15]
* @param {Function} [option.endedCallback]
* @constructor
*/