Skip to content

Instantly share code, notes, and snippets.

View jph00's full-sized avatar
🦘

Jeremy Howard jph00

🦘
View GitHub Profile
@jph00
jph00 / hbr-questions.md
Created September 28, 2024 14:38
The Surprising Power of Questions - HBR

The Surprising Power of Questions

It goes far beyond exchanging information.

by

  • Alison Wood Brooks
  • Leslie K. John

From Harvard Business Review Magazine (May–June 2018)

@jph00
jph00 / pathos.md
Last active February 9, 2025 16:56
Explaining Pathos in Ancient Epics and today: Claude Conversation

Explaining Pathos in Ancient Epics and today

🧑 human (Sep 21, 2024, 06:13 PM)

What is pathos, and what's it got to do with Virgil or Homer? Explain for a 12 y.o.

🤖 assistant (Sep 21, 2024, 06:13 PM)

Pathos is a way of making people feel emotions when they read or hear something. It's like when a story makes you feel sad, happy, or excited.

Virgil and Homer were famous ancient Greek and Roman poets who wrote epic stories. They used pathos a lot in their writing to make readers really care about what was happening.

For example:

@jph00
jph00 / csv-serve-main.py
Last active May 14, 2025 14:24
CSV editor sample
from fasthtml.common import *
db = database(':memory:')
tbl = None
hdrs = (Style('''
button,input { margin: 0 1rem; }
[role="group"] { border: 1px solid #ccc; }
'''), )
app, rt = fast_app(live=True, hdrs=hdrs)
@jph00
jph00 / sqlite.ipynb
Last active February 21, 2025 11:53
Simple overview of fastlite and sqlite-utils
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jph00
jph00 / ds_payroll.csv
Created September 5, 2024 05:25
Death Star payroll sample CSV
id name species home_planet department position midi_chlorian_count force_sensitive blaster_accuracy date_recruited salary_credits
1 Darth Vader Human Tatooine Command Supreme Commander 27700 True 95.5 19BBY 1000000
2 Grand Moff Tarkin Human Eriadu Administration Grand Moff 0 False 88.2 22BBY 500000
3 TK-421 Human Coruscant Security Stormtrooper 120 False 62.7 10BBY 50000
4 DS-61-2 Droid Geonosis Maintenance Trash Compactor Droid 0 False 0.0 14BBY 0
5 Kylo Ren Human Chandrila Command Dark Side Apprentice 20000 True 89.3 5ABY 750000
6 General Hux Human Arkanis Military General 0 False 79.1 3ABY 400000
7 Captain Phasma Human Parnassos Security Stormtrooper Captain 50 False 91.8 7ABY 200000
8 Galen Erso Human Grange Weapons Research Chief Scientist 10 False 30.5 17BBY 300000
9 Orson Krennic Human Lexrul Weapons Development Director 0 False 75.6 30BBY 450000

Building Hypermedia Apps with FastHTML

🧑 human (Sep 5, 2024, 02:05 PM)

How can FastHTML help me write Hypermedia applications?

🤖 assistant (Sep 5, 2024, 02:05 PM)

FastHTML is designed to help you write hypermedia applications efficiently by providing a framework that aligns closely with hypermedia principles. Here are some key ways FastHTML can assist:

  1. Simplified routing and handlers: FastHTML allows you to create routes using concise decorators:

Hypermedia Systems: book summary

This is a summary of "Hypermedia Systems" by Carson Gross, Adam Stepinski, Deniz Akşimşek. Summary created by Jeremy Howard with AI help.

  • Website for the book
  • The revolutionary ideas that empowered the Web
  • A simpler approach to building applications on the Web and beyond with htmx and Hyperview
  • Enhancing web applications without using SPA frameworks

1: Hypermedia: A Reintroduction

@jph00
jph00 / starlette-quick.md
Last active December 9, 2024 20:44
Starlette Quick Manual for FastHTML users

🌟 Starlette Quick Manual

2020-02-09

Starlette is the ASGI web framework used as the foundation of FastHTML. Listed here are some Starlette features FastHTML developers can use directly, since the FastHTML class inherits from the Starlette class (but note that FastHTML has its own customised RouteX and RouterX classes for routing, to handle FT element trees etc).

Get uploaded file content

@jph00
jph00 / run_coro.py
Created August 28, 2024 08:48
A possibly useful async2sync convertor
import asyncio
from inspect import iscoroutine, isasyncgen
from concurrent.futures import ThreadPoolExecutor
import nest_asyncio
nest_asyncio.apply()
def _iter_coro(r):
loop = asyncio.get_event_loop()
if loop.is_running():
@jph00
jph00 / pep517-warning.md
Last active August 27, 2024 14:31
Adding a minimal pyproject.toml - Claude chat

🧑 human (Aug 28, 2024, 12:01 AM)

DEPRECATION: Legacy editable install of coreg[dev]==0.14.0 from file:///... (setup.py develop) is deprecated. pip 25.0 will enforce this behaviour change. A possible replacement is to add a pyproject.toml or enable --use-pep517, and use setuptools >= 64. If the resulting installation is not behaving as expected, try using --config-settings editable_mode=compat. Please consult the setuptools documentation for more information. Discussion can be found at pypa/pip#11457

I just started getting the above error when I pip install -e . of one of my own packages. I maintain a number of libs that I want people to be able to do editable installs of. I'd rather not require users add extra flags when doing editable installs of them. pyproject.toml doesn't support the features I need, so I have to use setup.py. Is there a way I can set this up?

🤖 assistant (Aug 28, 2024, 12:01 AM)

To address this issue while maintaining compatibility and ease of use for your users, y