Skip to content

Instantly share code, notes, and snippets.

View pydanny's full-sized avatar

Daniel Roy Greenfeld pydanny

View GitHub Profile
@pydanny
pydanny / not-nulls.ipynb
Last active December 28, 2024 00:24
fasthtml/not-nulls.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pydanny
pydanny / check bools.ipynb
Created December 28, 2024 00:10
fasthtml/check bools.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pydanny
pydanny / check bools.ipynb
Created December 28, 2024 00:03
fasthtml/check-bools.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pydanny
pydanny / install-notes.md
Last active October 3, 2024 12:51
New mac installation

Terminal first!

  1. Try to avoid downloading anything directly. Rather, use homebrew, uv, and gh cli to install everything.
  2. At the end of each install, add the items suggested for going into the .zshrc

Install homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@pydanny
pydanny / websockets_example.ipynb
Last active September 23, 2024 18:03
FastHTML plus Jupyter plus websockets
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pydanny
pydanny / data.ipynb
Created September 5, 2024 06:31
fasthtml-pk-search.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""Another pure FastHTML method, only dependency is python-fasthtml."""
import asyncio
import random
from fasthtml.common import *
from starlette.responses import StreamingResponse
sselink = Script(src="https://unpkg.com/[email protected]/sse.js")
htmx_log = Script("htmx.logAll();"),
app, rt = fast_app(hdrs=(sselink,htmx_log))
lst = [190,200,210,70,60,150,170,90]
previous = 0
streak_length = 0
for current in lst:
if previous < current:
streak_length += 1
else:
print(streak_length)
previous = 0
  1. Build the project locally to make sure it builds
pip install -U build
python -m build