I made this Toga app as a Bash one-liner:
python -c '
import toga
import urllib.request
import json
def fetch_json(url):
with urllib.request.urlopen(url) as response:
if response.getcode() == 200:| Metadata-Version: 2.1 | |
| Name: testcontainers-postgres | |
| Version: 0.0.1rc1 | |
| Summary: PostgreSQL component of testcontainers-python. | |
| Home-page: https://github.com/testcontainers/testcontainers-python | |
| Requires-Python: >=3.7 | |
| Description-Content-Type: text/x-rst | |
| Requires-Dist: testcontainers-core | |
| Requires-Dist: sqlalchemy | |
| Requires-Dist: psycopg2-binary |
| import sqlite3 | |
| # Connect to the test.db database | |
| conn = sqlite3.connect(":memory:") | |
| cursor = conn.cursor() | |
| # Create the news table | |
| cursor.execute( | |
| """ | |
| CREATE TABLE IF NOT EXISTS news ( |
I made this Toga app as a Bash one-liner:
python -c '
import toga
import urllib.request
import json
def fetch_json(url):
with urllib.request.urlopen(url) as response:
if response.getcode() == 200:| BEGIN TRANSACTION; | |
| CREATE TABLE [ios] ( | |
| [ios] TEXT, | |
| [path] TEXT, | |
| [parent] TEXT, | |
| [filename] TEXT, | |
| [languages] TEXT | |
| ); | |
| INSERT INTO "ios" VALUES('iOS1','/Applications/Calculator.app/Calculator','/Applications/Calculator.app','Calculator','["Objective-C"]'); | |
| INSERT INTO "ios" VALUES('iOS1','/Applications/DemoApp.app/DemoApp','/Applications/DemoApp.app','DemoApp','["Objective-C"]'); |
| .grow-wrap { | |
| /* easy way to plop the elements on top of each other and have them both sized based on the tallest one's height */ | |
| display: grid; | |
| } | |
| .grow-wrap::after { | |
| /* Note the weird space! Needed to preventy jumpy behavior */ | |
| content: attr(data-replicated-value) " "; | |
| /* This is how textarea text behaves */ | |
| white-space: pre-wrap; |
| # pip install flet httpx | |
| import flet as ft | |
| import httpx | |
| def main(page: ft.Page): | |
| rows = httpx.get("https://simon.datasette.cloud/data/hacker_news_posts.json?_sort_desc=dt").json()["rows"] | |
| first_row = rows[0] | |
| page.scroll = ft.ScrollMode.ALWAYS | |
| page.add( |
I got GPT-4 Code Interpreter to write most of this for me, transcript here
I had to modify it a tiny bit to get it to run, the parameters for the queries were missing.
Results on my M2 MacBook Pro:
---------------
Mode | Scenario | Update QPS | Select QPS
---------------
| #!/bin/bash | |
| # Get the list of changed files | |
| files=$(git diff --name-only) | |
| # Loop through each changed file | |
| for file in $files; do | |
| # Show the diff of the file | |
| git diff $file |
| [project] | |
| name = "sqlite-utils-litecli" | |
| version = "0.1" | |
| dependencies = [ | |
| "litecli" | |
| ] | |
| [project.entry-points.sqlite_utils] | |
| litecli = "sqlite_utils_litecli" |