Skip to content

Instantly share code, notes, and snippets.

View libook's full-sized avatar
🎵
Never Gonna Give You Up~

Daniel Li libook

🎵
Never Gonna Give You Up~
View GitHub Profile
@libook
libook / bump-version.sh
Created December 10, 2020 06:36 — forked from Nomane/bump-version.sh
Bump version shell script.
#!/bin/bash
# Thanks goes to @pete-otaqui for the initial gist:
# https://gist.github.com/pete-otaqui/4188238
#
# Original version modified by Marek Suscak
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3" or even "1.2.3-beta+001.ab"
@libook
libook / shadowsocks-server.service
Created August 8, 2017 03:50 — forked from guyskk/shadowsocks-server.service
shadowsocks server systemd service
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/ss-config.json
Restart=on-abort
[Install]
WantedBy=multi-user.target
@libook
libook / github-latest-release.sh
Last active May 3, 2018 15:51 — forked from 0xadada/github-latest-release.sh
Download latest GitHub project release
#!/bin/zsh
for url in `curl --silent https://api.github.com/repos/$1/releases/latest | awk '/browser_download_url/ { print $2 }' | sed 's/"//g'`
do
echo $url
curl -LOk $url
done
@libook
libook / runService.sh
Created July 24, 2017 06:27 — forked from Chunlin-Li/runService.sh
项目启动脚本 (10.8.8.8 使用)
#!/usr/bin/env bash
ProjectName="sundries" # 项目名称
Port=3030 # 服务监听端口 , 通过设置 NODE_PORT 环境变量实现
CleanNodeModules=true # 是否每次都清除 node_modules
NodeVersion=8.1.2 # node 版本, 需确保 nvm 有该版本
Restart=true # 是否每次都重启服务
if [[ -e $1 ]]; then
@libook
libook / complement.js
Last active August 29, 2015 14:17 — forked from r3b/complement.js
// returns things in array 'a' that are not in array 'b'
// > ['a','b','c','1', '2', '3'].complement(['b', 'c', 'd', 'e']);
// ['a', '1', '2', '3']
function complement(a, b){
(b)||(b=a, a=this);
return (Array.isArray(a) && Array.isArray(b))
? a.filter(function(x){return b.indexOf(x)===-1;})
: undefined;
}
Array.prototype.complement=complement;