快捷键 | 功能 |
---|---|
cmd + shift + p | 打开命令菜单 |
cmd + t | 模糊搜索工作目录下的文件 |
cmt + b | 搜索已经打开的文件 |
ctrl + 0 | 焦点移动到文件目录 |
cmd + \ | 隐藏左侧目录树 |
ctrl + [ | 目录中展开结点 |
ctrl + ] | 目录中缩起结点 |
d / a / m | 对目录选中的结点进行 删除 / 添加 / 移动 |
View atom的mac快捷键.md
View delete_git_submodule.md
To remove a submodule you need to:
- Delete the relevant section from the .gitmodules file.
- Stage the .gitmodules changes git add .gitmodules
- Delete the relevant section from .git/config.
- Run git rm --cached path_to_submodule (no trailing slash).
- Run rm -rf .git/modules/path_to_submodule (no trailing slash).
- Commit git commit -m "Removed submodule "
- Delete the now untracked submodule files rm -rf path_to_submodule
View docker_remove.sh
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 | |
docker rm $(docker ps -a -q) | |
docker rmi $(docker images -q) | |
docker rmi $(docker images --filter "dangling=true" -q --no-trunc) | |
docker images | grep "superset" | awk '{print $3}' | xargs docker rmi |
View pandas_reorder_column.py
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
""" | |
sort by column in multi level dataframes | |
""" | |
import pandas | |
data = {'active_days': [2,6,1, 2], | |
'province': ['beijing', 'shanghai', 'shanghai','beijing'], | |
'__timestamp': ['2018-09-17', '2018-09-24', '2018-08-20', '2018-09-17'], | |
'sum(active_days_user)': [1033604, 256682, 3613940, 1]} |
View python_logging_config.py
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
import logging | |
logging.basicConfig( | |
level=logging.INFO, | |
format= | |
'%(asctime)s pid:%(process)d %(levelname)s (%(filename)s:%(lineno)d)- %(message)s' | |
) |
View python_2_and_3_compatible.py
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
# -*- coding: utf-8 -*- | |
from __future__ import absolute_import | |
from __future__ import division | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
if sys.version_info >= (3, 0): | |
from urllib.parse import urlparse | |
else: | |
from urlparse import urlparse |
View itertools_demo.py
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
import os | |
from itertools import groupby | |
input2 = [ | |
{'dept': '001', 'sku': 'foo', 'transId': 'uniqueId1', 'qty': 100}, | |
{'dept': '001', 'sku': 'bar', 'transId': 'uniqueId2', 'qty': 200}, | |
{'dept': '001', 'sku': 'foo', 'transId': 'uniqueId3', 'qty': 300}, | |
{'dept': '002', 'sku': 'baz', 'transId': 'uniqueId4', 'qty': 400}, | |
{'dept': '002', 'sku': 'baz', 'transId': 'uniqueId5', 'qty': 500}, |
View s3_bucket_list.py
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
# 找到某个bucket 下, 限定prefix下, 所有的key | |
import os | |
import boto3 | |
bucket_name = 'tmp-bucket' | |
_s3 = boto3.resource('s3',region_name='cn-north-1') | |
print _s3 | |
bucket = _s3.Bucket(bucket_name) | |
print bucket.name | |
all_objects = _s3.meta.client.list_objects(Bucket = bucket_name) |
View shell_date_add.sh
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 | |
for i in `seq 1 355`; | |
do | |
data_date=`date -v -${i}d +%F` | |
echo $data_date | |
done |
NewerOlder