This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
[[ $EUID -ne 0 ]] && exec sudo $0 -- $@ | |
set -e | |
command=${2:-help} | |
port=${3:-1024} | |
CHNROUTE_FILE="`dirname "$0"`/chnroute.txt" | |
IGNORE_FILE="`dirname "$0"`/ignore.txt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# by Felix Yan <https://github.com/felixonmars> | |
# stat of system update | |
echo $(head -n1 /var/log/pacman.log | cut -d " " -f 1,2) 以来一共滚了 $(grep -c "full system upgrade" /var/log/pacman.log) 次 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-package! liberime-config) | |
(use-package! pyim | |
;; :quelpa (pyim :fetcher github :repo "merrickluo/pyim") | |
:init | |
(setq pyim-title "R") | |
:config | |
;; (use-package pyim-basedict | |
;; :config | |
;; (pyim-basedict-enable)) | |
(global-set-key (kbd "M-j") 'pyim-convert-string-at-point) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#main-window:not([tabsintitlebar="true"]) #TabsToolbar > .toolbar-items { | |
visibility: collapse !important; | |
} | |
#main-window #titlebar { | |
height: 0; | |
min-height: 0; | |
} | |
#main-window #titlebar .titlebar-spacer { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unmap b | |
unmap B | |
map b :buffer<Space> | |
map B :bookmark<Space> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
[[ $UID != 0 ]] && exec sudo -E "$(readlink -f "$0")" "$@" | |
up() { | |
# setup wg0 | |
ip link add dev wg0 type wireguard | |
ip addr add dev wg0 10.0.200.13/32 | |
wg setconf wg0 /etc/wireguard/wg0.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
usb device 0 | |
corsair device 0 | |
corsair device 1 | |
corsair device 2 | |
corsair device 3 | |
corsair device 4 | |
corsair device 5 | |
corsair device 6 | |
corsair device 7 | |
corsair device 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking USB device 0 (1d6b:0003)... | |
Checking USB device 1 (1d6b:0002)... | |
Checking USB device 2 (1d6b:0003)... | |
Checking USB device 3 (046d:c539)... | |
Checking USB device 4 (04b4:0101)... | |
Checking USB device 5 (05e3:0608)... | |
Checking USB device 6 (05fc:0231)... | |
Checking USB device 7 (045e:02d1)... | |
Checking USB device 8 (0b05:1825)... | |
Checking USB device 9 (1b1c:0c03)... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer') | |
const run = async function () { | |
const browser = await puppeteer.launch({ | |
args: ['--no-sandbox'], | |
}) | |
const page = await browser.newPage() | |
await page.goto('http://www.4gamer.net/games/117/G011794/20180111081/') | |
const games = await page.$("table.SALES_RANKING") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const isAllzero = function (num) { | |
return (num.toString().replace(/0/g, '') === '1') | |
} | |
const nextNumber = function (current, limit) { | |
const longer = parseInt(`${current}0`) | |
if (longer <= limit) { | |
return longer | |
} | |
const bigger = current + 1 |