Skip to content

Instantly share code, notes, and snippets.

@hcpl
hcpl / test.rst
Last active October 15, 2017 00:27
reStructuredText TOML test
[dependencies]
either = { version = "1.0", features = ["serde"] }
@hcpl
hcpl / C_bathroom_stalls.py
Last active April 9, 2017 09:34
A formula solution for Google Code Jam 2017 problem C (Bathroom Stalls)
def maxminlr(stalls_count, users_count):
order = users_count.bit_length() - 1
pow_two = 2 ** order
k, p = divmod(stalls_count, pow_two * 2)
t = users_count
if p in range(0, t - pow_two):
return (k - 1, k - 1)
elif p in range(t - pow_two, t):
@hcpl
hcpl / README.rst
Last active November 1, 2016 18:50
Issue with subsequent section and subsection

test-repo

Subtitle

Table of Contents

import i3pystatus.backlight as backlight
import os
import pytest
from contextlib import contextmanager
from operator import itemgetter
from tempfile import TemporaryDirectory