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
server { | |
listen 80; | |
listen [::]:80; | |
server_name example.cc; | |
# client_max_body_size 1M; | |
location / { | |
proxy_pass http://localhost:8080; |
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
# Launch the editor: sudo crontab -e | |
# | |
# For more information see the manual pages of crontab(5) and cron(8) | |
# | |
# m h dom mon dow command | |
M H * * * certbot renew --post-hook "service nginx restart" | |
# M should be a random number range: 0..59 | |
# H should be a random number range: 0..23 |
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
wget \ | |
--recursive \ | |
--level=inf \ | |
--waitretry=10 \ | |
--retry-connrefused \ | |
--page-requisites \ | |
--convert-links \ | |
--html-extension \ | |
--adjust-extension \ | |
--span-hosts \ |
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
let time = 0 | |
Date.now = () => { | |
time++ | |
return time | |
} | |
class Cache { | |
pool = {} | |
size = 0 |
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 | |
set -o pipefail | |
FILTER_BRANCH_SQUELCH_WARNING=1 git filter-branch --force --index-filter "git rm --cached --ignore-unmatch $@" --prune-empty --tag-name-filter cat -- --all |
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 | |
set -o pipefail | |
case "$1" in | |
-s|--sum) | |
git rev-list --objects --all \ | |
| git cat-file --batch-check='%(objecttype) %(objectsize) %(rest)' \ | |
| sed -n 's/^blob //p' \ | |
| awk '{x+=$1}END{print x}' \ | |
| $(command -v gnumfmt || echo numfmt) --field=1 --to=iec-i --suffix=B --round=nearest |
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 node | |
let fs = require('fs'); | |
let path = require('path'); | |
let util = require('util'); | |
let target = { | |
files: [ | |
'workspace.xml', | |
], | |
dirs: [ |
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
command_not_found_handle() { | |
# Do not run within a pipe | |
if test ! -t 1; then | |
echo "command not found: $1" >&2 | |
return 127 | |
fi | |
# run local npm package if exist | |
cmd="node_modules/.bin/$1" | |
if [ -f "$cmd" ]; then |
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 | |
set -o pipefail | |
echo >&2 original: yarn $@ | |
if [ "$1" == 'install' ] || [ "$1" == 'add' ] ; then | |
shift | |
if [ "$1" == '--silent' ]; then | |
shift | |
fi | |
echo >&2 mapto: pnpm install --prefer-offline $@ |
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 | |
set -o pipefail | |
case "$1" in | |
i|install) | |
shift | |
case "$1" in | |
-g|--global) | |
shift | |
npx --no npm i -g $@ |
NewerOlder