This file contains 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
<html> | |
<body> | |
<svg class="rich-terminal" viewBox="0 0 1221.6000000000001 549" xmlns="http://www.w3.org/2000/svg"> | |
<style> | |
@font-face { | |
font-family: "Fira Code"; | |
src: local("FiraCode-Regular"), | |
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2") format("woff2"), | |
url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff") format("woff"); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
def partition_will(pred, values): | |
if not values: | |
return [], [] | |
if len(values) == 1: | |
return ([], values) if pred(values[0]) else (values, []) | |
values = sorted(values, key=pred) | |
lower = 0 | |
upper = len(values) | |
index = (lower + upper) // 2 | |
try: |
This file contains 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 typing import NamedTuple | |
class Region(NamedTuple): | |
x: int | |
y: int | |
width: int | |
height: int | |
This file contains 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
@lru_cache(maxsize=4096) | |
def intersection(self, region: Region) -> Region: | |
"""Get the overlapping portion of the two regions. | |
Args: | |
region (Region): A region that overlaps this region. | |
Returns: | |
Region: A new region that covers when the two regions overlap. | |
""" |
This file contains 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
def segments_float(size, parts): | |
end = 0.0 | |
part = size / parts | |
for n in range(parts): | |
start = int(end) | |
end += part | |
print(str(n) * int(end - start), end="") | |
print() | |
This file contains 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
TimerWidget { | |
layout: horizontal; | |
height: 5; | |
background: $panel-darken-1; | |
border: tall $panel-darken-2; | |
margin: 1; | |
padding: 0 1; | |
transition: background 200ms linear; | |
} |
This file contains 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
Stopwatch { | |
layout: horizontal; | |
background: $panel-darken-1; | |
height: 5; | |
min-width: 50; | |
margin: 1; | |
padding: 1; | |
} | |
TimeDisplay { |
This file contains 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
Screen { | |
overflow: auto; | |
} | |
#calculator { | |
layout: table; | |
table-size: 4; | |
table-gutter: 1 2; | |
table-columns: 1fr; | |
table-rows: 2fr 1fr 1fr 1fr 1fr 1fr; |
This file contains 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
Cook the pinto beans in a pressure cooker with 3 parts water to 1 part beans, and some salt. | |
While that is cooking dice an onion and 3 stalks of cellery, add a few cloves of garlic crushed with a knife. Fry lightly and stir for around 20 minutes. Add sliced sausage and fry for another 10 minutes. | |
When the beans are ready take a couple of scoops and add them to the onion mixture. Mash the beans so they are completely broken down (this will thicken the sauce). Add paprika, chipotle, tomatoe puree and black bepper, then combine with the beans. | |
Simmer for another 10 minutes or so until the sauce thickens. Add some vinegar and chopped parsely near the end. |