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
public static void main(String[] args){ | |
//获得当前日期 2016-10-09T13:15:16.386 | |
LocalDateTime now = LocalDateTime.now(); | |
System.out.println("now = " + now); | |
//获得3天后 2016-10-12T13:21:01.215 | |
LocalDateTime threeDaysAfterNow = now.plusDays(3); | |
System.out.println("threeDaysAfterNow = " + threeDaysAfterNow); |
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
/** | |
* 原始日期类型 | |
* YYYY-MM-DD HH24:MI:ss | |
* YYYY-MM-DD HH24:MI:ss.0 | |
* YYYY-MM-DD | |
* YYYYMMDD | |
* 转换 | |
* 成YYYY-MM-DDTHH24:mi:ss | |
* '2016-01-01T12:00:00 | |
* |
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
" xyz ".strip() # returns "xyz" | |
" xyz ".lstrip() # returns "xyz " | |
" xyz ".rstrip() # returns " xyz" | |
" x y z ".replace(' ', '') # returns "xyz" |
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
#注意:.env中变量的写法一般是 TEST_KEY = TEST_VALUE。最好去除每个字符两边的空格,否则加到环境变量里也读取不到 | |
def import_env(): | |
if os.path.exists('.env'): | |
print('Importing environment from .env...') | |
for line in open('.env'): | |
var = line.strip().split('=') | |
if len(var) == 2: | |
key, value = var[0].strip(), var[1].strip() | |
os.environ[key] = value | |
print(os.environ.get('MAIL_SERVER')) |
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
http://stackoverflow.com/questions/34631806/fail-during-installation-of-pillow-python-module-in-linux | |
测试成功 |
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
#[Pillow说明文档][1] | |
#[1]:https://pillow.readthedocs.org/en/3.1.x/ | |
#压缩图片尺寸 | |
from __future__ import print_function | |
import os, sys | |
from PIL import Image | |
size = (128, 128) | |
for infile in sys.argv[1:]: |
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
git config --global https.proxy http://127.0.0.1:1080 | |
git config --global https.proxy https://127.0.0.1:1080 | |
git config --global --unset http.proxy | |
git config --global --unset https.proxy | |
npm config delete proxy |