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
// Package main is a sample macOS-app-bundling program to demonstrate how to | |
// automate the process described in this tutorial: | |
// | |
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5 | |
// | |
// Bundling the .app is the first thing it does, and creating the DMG is the | |
// second. Making the DMG is optional, and is only done if you provide | |
// the template DMG file, which you have to create beforehand. | |
// | |
// Example use: |
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 datetime | |
from django.utils.timezone import utc | |
start_date = datetime.datetime.utcnow().replace(tzinfo=utc) - datetime.timedelta(minutes=1) | |
end_date = datetime.datetime.utcnow().replace(tzinfo=utc) | |
old_date = datetime.datetime(2013, 1, 1).replace(tzinfo=utc) | |
run_crons = applyDB.objects.filter(status='2', apply_run_time__range=(start_date, end_date)) # 申请通过,到期执行 | |
old_crons = applyDB.objects.filter(status='1', apply_run_time__range=(old_date, end_date)) # 申请到期未审核 |
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
d0 删至行首。 | |
d$ 删至行尾。 | |
dw 删除到某个单词的结尾位置 | |
D 删除到行尾 | |
x,y 删除与复制包含高亮区 | |
dL 删除直到屏幕上最后一行的内容 | |
dH 删除直到屏幕上第一行的内容 | |
dd 删除当前行 | |
ndd 删除当前行及其后 n-1 行。 | |
x 或 X 删除一个字符。 |
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 uwsgi | |
from uwsgidecorators import timer | |
from django.utils import autoreload | |
@timer(3) | |
def change_code_gracefull_reload(sig): | |
if autoreload.code_changed(): | |
uwsgi.reload() |
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
#!/bin/bash | |
#set -x | |
if [ "$#" -lt 2 ] | |
then | |
echo -e "Not enouth args" | |
exit 1 | |
fi |