Skip to content

Instantly share code, notes, and snippets.

You are Ned, a chicken. Countless friends of yours have been slaughtered by
humankind. You are desperate to retaliate. You will do anything...
> You search the barn.
You look around and see that there is nothing but dirt in front of you. It's
just a plain field with no trees or buildings anywhere near it. You can hear
the sound of horses galloping nearby, probably from the farmhouse
> You practice flying skills.

Keybase proof

I hereby claim:

  • I am xtendo-org on github.
  • I am xtendo (https://keybase.io/xtendo) on keybase.
  • I have a public key ASCPcEn6zTGC47F8kj1wL1TkHO5a4odbOGO-vUtac-DHjAo

To claim this, I am signing this object:

import os
CHUNK_SIZE = 1024
def remove_last_line(path):
with open(path, 'rb+') as f:
def process_chunk(base_offset, chunk):
try:
f.seek(base_offset + chunk.rindex(b'\n'), os.SEEK_SET)
@xtendo-org
xtendo-org / list_comprehension.py
Created May 18, 2017 09:35
Python: List comprehension v. map and lambda
import itertools
import time
list1 = [x for x in range(3000)]
list2 = [x for x in range(3000,6000)]
a = time.time()
correct = [a == b for (a, b) in itertools.product(list1, list2)]
b = time.time()
print("{0:20}: {1} sec".format("List comprehension", b-a))
@xtendo-org
xtendo-org / mcdcheck.py
Created May 13, 2017 17:32
맥딜리버리 주문가능 상태 체크하기
# Usage: Create ~/.ssh/mcd.yaml like
#
# username: smith@example.com
# password: mypassword
#
# then run this file.
# Requires requests and PyYAML. Tested with Python 3.6.2.
import datetime
import os.path
@xtendo-org
xtendo-org / Envy Code R Bold for Powerline.ttf
Created October 19, 2015 04:11
Envy Code R fonts patched for Powerline