Skip to content

Instantly share code, notes, and snippets.

View ty4z2008's full-sized avatar
🎯
Focusing

Jun Liao ty4z2008

🎯
Focusing
View GitHub Profile
@ty4z2008
ty4z2008 / snell.sh
Last active November 18, 2019 08:17
snell server install script for centos . latest version https://github.com/surge-networks/snell/releases/latest
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
CONF="/etc/snell/snell-server.conf"
SYSTEMD="/etc/systemd/system/snell.service"
yum install unzip -y
cd ~/
wget --no-check-certificate -O snell.zip https://github.com/surge-networks/snell/releases/download/v1.1.1/snell-server-v1.1.1-linux-amd64.zip
unzip -o snell.zip
rm -f snell.zip
@ty4z2008
ty4z2008 / git alias
Last active May 6, 2019 06:43
git alias list
g: aliased to git
gca: aliased to git commit -v -a
gc: aliased to git commit -v
ga: aliased to git add
gm: aliased to git merge
gl: aliased to git pull
gp: aliased to git push
gr: aliased to git remote
gf: aliased to git fetch
gg: aliased to git gui citool
@ty4z2008
ty4z2008 / aliyun-oss.sh
Created December 4, 2019 09:44
aliyun oss uploader with curl
#!/usr/bin/env bash
#
# Replace below arguments before use
# OSS_ACCESS_KEY_ID 、OSS_ACCESS_KEY_SECRET、BUCKET、ENDPOINT、DIRECTORY
#
# This example will upload file to hangzhou Aliyun object stroage system
# Usage: ./oss.sh test.sh
#
echo "upload file $1"
@ty4z2008
ty4z2008 / surge.js
Last active May 21, 2023 03:59
获取ss订阅地址为surge 配置
/**
* Usage :
*
* node > 12.13
*
* npm install pinyin request
*
* export SSR_URL=xxxxx
*
* node surge.js
@ty4z2008
ty4z2008 / filename.txt
Last active March 10, 2020 14:22
读取filename.txt,对image目录下面的文件重命名
001 (1).jpg,111.jpg
001 (2).jpg,ddsg.jpg
001 (3).jpg,腊.jpg
@ty4z2008
ty4z2008 / lanuch.json
Created April 8, 2020 03:02
use ts-node debug typescript in visual code of config
{
"version":"0.3.0",
"configurations":[
{
"name": "Websocket-debug",
"type": "node",
"request": "launch",
"args": ["${workspaceRoot}/server/websocket/src/index.ts"],
"runtimeArgs": ["-r", "ts-node/register"],
"cwd": "${workspaceRoot}",
@ty4z2008
ty4z2008 / simulate.js
Created April 16, 2020 02:42
use js simulate click and input in react or vue.
/**simluate click in react */
function simulateClick(element) {
if (element instanceof jQuery) {
element = element[0]
}
const mouseClickEvents = ['mousedown', 'click', 'mouseup']
console.log('[spirit] simulate click:', element)
mouseClickEvents.forEach(mouseEventType =>
element.dispatchEvent(
new MouseEvent(mouseEventType, {