Skip to content

Instantly share code, notes, and snippets.

View ihoey's full-sized avatar
🎯
Focusing

Ihoey ihoey

🎯
Focusing
View GitHub Profile
@ihoey
ihoey / pre-push
Created May 21, 2019 08:39 — forked from StuPig/pre-push
禁止直接向master和develop分之提交代码的钩子,放在.git/hooks/pre-push
#!/bin/bash
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ "$current_branch" = "master" ] || [ "$current_branch" = "develop" ]; then
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ""
echo "禁止直接向master或develop分支提交代码!"
echo ""
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
exit 1
@ihoey
ihoey / count.js
Created July 21, 2018 05:46 — forked from ecmadao/count.js
js 数字滚动效果
const {
elem, // 数字要变化的元素
endVal = 100, // 最终显示数字
startVal = 0, // 数字变化开始值
duration = 1500, // 变化持续时间 (ms)
decimal = 0 // 小数点位数
} = options;
let startTime = 0;
const dec = Math.pow(10, decimal);
@ihoey
ihoey / nginx.conf
Created May 24, 2018 09:02 — forked from mtigas/nginx.conf
Nginx configuration for securedrop.propublica.org. (Based on Ubuntu 13.10 / Nginx 1.4.1 default config.)
# This configuration file is provided on an "as is" basis,
# with no warranties or representations, and any use of it
# is at the user's own risk.
#
# You will need to edit domain name information, IP addresses for
# redirection (at the bottom), SSL certificate and key paths, and
# the "Public-Key-Pins" header. Search for any instance of "TODO".
user www-data;
worker_processes 4;
@ihoey
ihoey / .zshrc
Created May 19, 2018 10:13 — forked from STAR-ZERO/.zshrc
PROMPTに顔文字(oh-my-zshのrobbyrussellテーマに追加)
#顔文字固定で色ランダム
PROMPT=$'%{\e[$[32+$RANDOM % 5]m%}(。◕‿◕。)%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'
#顔文字も色もランダム
FACE_CHAR=("(。◕‿◕。) " "(・∀・)ノ " "( ゚Д゚) " "(。╹ω╹。)" "♡♡♡♡" "☆☆☆☆")
PROMPT=$'%{\e[$[32+$RANDOM % 5]m%}$FACE_CHAR[$[$RANDOM % ${#FACE_CHAR[@]} + 1]]%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'