Skip to content

Instantly share code, notes, and snippets.

from random import randint
for i in range(20):
print([randint(-20, 20) for x in range(3)])
@apoluektov
apoluektov / pr_etiquette.md
Created March 20, 2018 23:11 — forked from mikepea/pr_etiquette.md
Pull Request Etiquette

Pull Request Etiquette

Why do we use a Pull Request workflow?

PRs are a great way of sharing information, and can help us be aware of the changes that are occuring in our codebase. They are also an excellent way of getting peer review on the work that we do, without the cost of working in direct pairs.

Ultimately though, the primary reason we use PRs is to encourage quality in the commits that are made to our code repositories

Done well, the commits (and their attached messages) contained within tell a story to people examining the code at a later date. If we are not careful to ensure the quality of these commits, we silently lose this ability.

@apoluektov
apoluektov / basic.py
Created June 12, 2017 19:00
JSON manipulation in Python
import json
def save():
data = { 'a': 1, 'b': 2, 'c': 3 }
with open('my/file/name.json') as fp:
json.dump(data, fp, sort_keys=True, indent=1)
def load():
with open('my/file/name.json') as fp:
data = json.load(fp)