This file contains hidden or 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 bash | |
| DATE=$(date '+%Y-%m-%d %H:%M') | |
| function network() { | |
| local timeout=2 | |
| local target=www.baidu.com | |
| local code=`curl -I -s --connect-timeout ${timeout} ${target} -w %{http_code} | tail -n1` | |
| if [ "Licsber$code" = "Licsber200" ]; then | |
| return 1 | |
| else |
This file contains hidden or 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
| import aip | |
| APP_ID = '1' | |
| API_KEY = '2' | |
| SECRET_KEY = '3' | |
| def run_all(c, start=0): | |
| dirs = dir(c) | |
| print(len(dirs)) |
This file contains hidden or 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
| FROM php:7.3-fpm-alpine | |
| LABEL MAINTAINER licsber@gmail.com | |
| RUN set -x \ | |
| && apk add --no-cache --update \ | |
| freetype libpng libjpeg-turbo \ | |
| freetype-dev libpng-dev libjpeg-turbo-dev \ | |
| && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ | |
| && docker-php-ext-install -j "$(getconf _NPROCESSORS_ONLN)" gd \ |
This file contains hidden or 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 python3 | |
| import os | |
| os.chdir(os.path.split(os.path.realpath(__file__))[0]) | |
| # 目录下如果存在日语 | |
| # os.system("nfd2nfc ./") | |
| for i in os.listdir('.'): |
This file contains hidden or 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 bash | |
| sudo docker run --rm -d \ | |
| --name=pt \ | |
| -e PUID=$(id -u) \ | |
| -e PGID=$(id -g) \ | |
| -e WEBUI_PORT=9000 \ | |
| -p 9000:9000 \ | |
| -p 46000:46000 \ | |
| -p 46000:46000/udp \ |
This file contains hidden or 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
| 🎮 Don't Starve Together 🕘 118 hrs 19 mins | |
| 🎮 Clicker Heroes 🕘 69 hrs 42 mins | |
| 🎮 Portal 2 🕘 67 hrs 12 mins | |
| 🎮 Human: Fall Flat 🕘 18 hrs 51 mins | |
| 🎮 Left 4 Dead 2 🕘 17 hrs 18 mins |
This file contains hidden or 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
| import threading | |
| import requests | |
| import urllib3 | |
| import queue | |
| import os | |
| urllib3.disable_warnings() | |
| class Downloader: |
This file contains hidden or 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
| b = [[1, 2], [3], [[1, [2]]]] | |
| flatten1 = lambda x: [y for l in x for y in flatten1(l)] if type(x) is list else [x] | |
| def flatten2(x): | |
| res = [] | |
| if type(x) is list: | |
| for l in x: | |
| for y in flatten2(l): |
This file contains hidden or 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
| git filter-branch -f --prune-empty --index-filter "git rm -rf --cached --ignore-unmatch filename" --tag-name-filter cat -- --all |
This file contains hidden or 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
| import os | |
| dirs = [] | |
| files = [] | |
| def walk(file): | |
| if os.path.isdir(file): | |
| dirs.append(file) | |
| for f in os.listdir(file): | |
| walk(file + '/' + f) |
NewerOlder