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
# Auto start screen when login | |
[[ -z "$STY" ]] && screen -x $USER || screen -S $USER && exit |
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
function __realpath__(){ | |
local CURRENT_DIR=$(pwd) | |
local TARGET_FILE=$1 | |
if [[ -e "$1" ]] | |
then | |
: | |
else | |
echo "$0: $1:No such file or directory" | |
return 1 | |
fi |
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 | |
NAME="blxkill" | |
function listProcesses(){ | |
ps -A -o pid,user,comm | awk 'NR>1' | |
} | |
function findPidByPort(){ | |
lsof -i :${1} -s TCP:LISTEN | awk 'NR == 2 {print $2}' |
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
// 定义一个函数 sync 封装一个同步函数静如异步队列。 | |
var sync = function(sync_func){ | |
return function(data, next){ | |
next(sync_func(data)); | |
}; | |
}; | |
// 将一个异步队列组合成一个可以执行的异步函数 | |
var compose = function(async_function_list, callback){ | |
return async_function_list.reduceRight(function(left, right){ |
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
function ncr(router){ | |
var path = process.argv.slice(2); | |
var current, i; | |
var next = router; | |
for(i=0; i<path.length; i++){ | |
current = next; | |
next = next[path[i]]; | |
if (typeof next === 'object') continue; else break; |
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
// Update At 2016-10-20 19:59:47; | |
var proxy = "SOCKS5 127.0.0.1:1080; SOCKS 127.0.0.1:1080; DIRECT;"; | |
var rules = { | |
"amazonaws.com": true, | |
"phonegap.com": true, | |
"wordpress.com": true, | |
"google.com": true, | |
"gmail.com": true, |
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 deps = {} | |
const resolve = p => { | |
if (!deps[p]){ | |
deps[p] = true | |
const p_deps = require(`${p}/package.json`).dependencies || [] | |
Object.keys(p_deps).forEach(function(p){ | |
return resolve(p) | |
}) | |
} | |
} |
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 | |
function __main__(){ | |
BACKUP_DIR=${HOME}/.autobackup | |
local op=${1} | |
shift | |
case ${op} in | |
"init") | |
init ${@} |
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
// ==UserScript== | |
// @name CL | |
// @namespace http://use.i.E.your.homepage/ | |
// @version 0.1 | |
// @description enter something useful | |
// @match http://t66y.com/htm_data/* | |
// @copyright 2012+, You | |
// @require http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js | |
// ==/UserScript== |
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 strict' | |
const request = require('request-promise-native').defaults({ | |
json: true, | |
headers: { | |
'systemVersionCode': '19', | |
'source': '4', | |
'SYSCODE': '20', | |
'versionCode': '32', | |
'deviceId': '865127010282718', |
OlderNewer