Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

KuKuXia KuKuXia

🎯
Focusing
View GitHub Profile
@KuKuXia
KuKuXia / iterator_chunk_size.py
Created Dec 28, 2019
利用迭代器实现数据的块输入
View iterator_chunk_size.py
"""
利用迭代器实现数据的块输入
"""
CHUNK_SIZE = 50
with open('somefile.txt') as f:
for chunk in iter(lambda: f.read(CHUNK_SIZE), ''):
print(chunk)
print('-' * 20)
@KuKuXia
KuKuXia / Revert-Gist.md
Created Jun 3, 2019 — forked from eduncan911/Revert-Gist.md
Revert Gist Commits
View Revert-Gist.md

Revert / Undo a Gist Commit

It was not exactly obvious. Here's how to revert a Gist commit!

Checkout the gist like a normal git repo:

# replace the Gist ID with your own
git clone git@github.com:cc13e0fcf2c348cc126f918e4a3917eb.git

Treat it like a normal repo. Edit, force push, etc.