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
sudo apt-get update -y | |
sudo apt-get upgrade -y | |
sudo add-apt-repository -y ppa:webupd8team/java | |
sudo apt-get update -y | |
sudo apt-get install oracle-java8-installer -y | |
sudo java -version | |
sudo apt-get install zookeeperd -y | |
netstat -ant | grep :2181 |
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
curl ipinfo.io/ip |
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
pip install pipreqs | |
pipreqs /path/to/project |
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 python | |
import sys, os, re | |
from subprocess import check_output | |
# 收集参数 | |
commit_msg_filepath = sys.argv[1] | |
if len(sys.argv) > 2: | |
commit_type = sys.argv[2] | |
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
db.gddata_daily_stats.update({'date':{'$lte':'2017-09-12','$gte':'2017-09-01'}},{$set : {"deleted_size": 0}},{upsert:false,multi:true}) |
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
up vote | |
67 | |
down vote | |
Use the datetime module. | |
This will yield start and end of week (from Monday to Sunday): | |
from datetime import datetime, timedelta |
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
Solution : | |
To Remove one folder | |
/Users/<your user>/Library/Application Support/Alfred 3/Workflow Data/de.gh01.alfred.github/ | |
Reinstall github workflow | |
Login github again. | |
gh > login |
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 | |
d = '2017-10-16' | |
df = datetime.datetime.strptime(d, '%Y-%m-%d') | |
df | |
Out[6]: datetime.datetime(2017, 10, 16, 0, 0) | |
df = df - datetime.timedelta(days=1) | |
df | |
Out[8]: datetime.datetime(2017, 10, 15, 0, 0) | |
df.strftime('%Y-%m-%d') |
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
What else can you do? | |
How to clone repository to a specific commit? (full clone) | |
# Create empty repository to store your content | |
git clone <url> | |
git reset <sha-1> --hard | |
More info: | |
How to clone single branch? |
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
df.somecolumn = df.somecolumn.astype(int) |
NewerOlder