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
### in zsh config | |
compdef _go go | |
### 补全脚本 | |
(pycharm_ascle) [~]$ cat .fpath/_go | |
#compdef go | |
_1st_arguments=( | |
"test" | |
"dev" |
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 | |
# -*- coding:utf-8 -*- | |
# | |
# Author : zhangxiaolin | |
# E-mail : [email protected] | |
# Date : 16/11/3 16:03 | |
# Desc : ... | |
from queue import Queue | |
import socket | |
import select |
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 | |
# -*- coding:utf-8 -*- | |
# | |
# Author : zhangxiaolin | |
# E-mail : [email protected] | |
# Date : 16/11/4 14:49 | |
# Desc : ... | |
""" | |
唯一一个限制字典:不能存以 `_` 开头的key |
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 django.core.paginator import Paginator | |
def chunked_iterator(queryset, chunk_size=10000): | |
paginator = Paginator(queryset, chunk_size) | |
for page in range(1, paginator.num_pages + 1): | |
for obj in paginator.page(page).object_list: | |
yield obj | |
for event in chunked_iterator(Event.objects.all()): | |
print event |
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
# Byte-compiled / optimized / DLL files | |
__pycache__/ | |
*.py[cod] | |
# C extensions | |
*.so | |
# VIM | |
*.swp |
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 os | |
import psutil | |
import resource | |
import subprocess | |
import sys | |
import time | |
NewerOlder