This file contains hidden or 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
import asyncio | |
from contextlib import asynccontextmanager | |
from datetime import datetime | |
import nats | |
from datastar_py.consts import ElementPatchMode | |
from datastar_py.starlette import datastar_response | |
from fastapi import FastAPI | |
from starlette.responses import HTMLResponse | |
from htpy import body, head, html, title, script, p, div |
This file contains hidden or 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
{ | |
"global" : { | |
"ask_for_confirmation_before_quitting" : true, | |
"check_for_updates_on_startup" : true, | |
"show_in_menu_bar" : true, | |
"show_profile_name_in_menu_bar" : false, | |
"unsafe_ui" : false | |
}, | |
"profiles" : [ { | |
"complex_modifications" : { |
This file contains hidden or 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
import re | |
from pathlib import Path | |
sample = """\ | |
0 3 6 9 12 15 | |
1 3 6 10 15 21 | |
10 13 16 21 30 45""" | |
def parse_line(line: str): |
This file contains hidden or 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
import re | |
from functools import reduce | |
from operator import mul | |
sample = """\ | |
Time: 7 15 30 | |
Distance: 9 40 200""" | |
puzzle_input = """\ | |
Time: 60 80 86 76 |
This file contains hidden or 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
import re | |
from collections import defaultdict | |
from dataclasses import dataclass | |
from pathlib import Path | |
sample = """\ | |
Card 1: 41 48 83 86 17 | 83 86 6 31 17 9 48 53 | |
Card 2: 13 32 20 16 61 | 61 30 68 82 17 32 24 19 | |
Card 3: 1 21 53 59 44 | 69 82 63 72 16 21 14 1 | |
Card 4: 41 92 73 84 69 | 59 84 76 51 58 5 54 83 |
This file contains hidden or 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
import re | |
from textwrap import dedent | |
import pytest | |
words = 'one two three four five six seven eight nine'.split() | |
def get_int_from(string: str): | |
if string.isnumeric(): | |
return int(string) | |
return words.index(string) + 1 |
This file contains hidden or 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
[build-system] | |
requires = ['setuptools'] | |
build-backend = 'setuptools.build_meta' | |
[project] | |
name = 'example' | |
version = '0.0.1' | |
dependencies = [ | |
"django", | |
] |
This file contains hidden or 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
This file contains any messages produced by compilers while | |
running configure, to aid debugging if configure makes a mistake. | |
It was created by python configure 3.11, which was | |
generated by GNU Autoconf 2.71. Invocation command line was | |
$ ./configure --prefix=/Users/chris/.pyenv/versions/3.11.4 --enable-shared --libdir=/Users/chris/.pyenv/versions/3.11.4/lib --with-openssl=/opt/homebrew/opt/openssl@3 | |
## --------- ## | |
## Platform. ## |
This file contains hidden or 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
import pwn | |
remote_host = "44.202.214.112" | |
remote_port = 1228 | |
conn = pwn.remote(remote_host, remote_port) | |
res = b'' | |
while res != b'\n': | |
res = conn.recvline() |
This file contains hidden or 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 dataclasses import dataclass, field | |
class PrintAccess: | |
def __set_name__(self, owner, name): | |
self.public_name = name | |
self.private_name = '_' + name | |
def __get__(self, obj, obj_type=None): |
NewerOlder