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
| #!/usr/local/bin/jq -rf | |
| tostream | |
| | select(length > 1) | |
| | ( | |
| .[0] | map( | |
| if type == "number" | |
| then "[" + tostring + "]" | |
| else "." + . | |
| end | |
| ) | join("") |
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 datasette_auth_github import GitHubAuth | |
| from starlette.applications import Starlette | |
| from starlette.responses import HTMLResponse | |
| import uvicorn | |
| app = Starlette(debug=True) | |
| @app.route("/") | |
| async def homepage(request): |
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
| # Use it like this: | |
| # | |
| # structlog.configure( | |
| # processors=[ | |
| # structlog.processors.JSONRenderer(), | |
| # LogToSqlite("/tmp/logs.db") | |
| # ] | |
| # ) | |
| # log = structlog.get_logger() | |
| # log.msg("say-hello", whom="world", num=[random.randint(1,55)]) |
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 contextlib | |
| import threading | |
| import sqlite3 | |
| class Connection: | |
| def __init__(self, name, db_conn): | |
| self.name = name | |
| self.db_conn = db_conn | |
| self.available = True |
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
| { | |
| "install": "pip3 install --user -r requirements.txt", | |
| "start": "PYTHONUNBUFFERED=true python3 server.py", | |
| "watch": { | |
| "ignore": [ | |
| "\\.pyc$" | |
| ], | |
| "install": { | |
| "include": [ | |
| "^requirements\\.txt$" |
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
| with recursive thread as ( | |
| select id, in_reply_to_status_id, 0 as depth | |
| from tweets | |
| where in_reply_to_status_id is null | |
| union | |
| select tweets.id, tweets.in_reply_to_status_id, 1 + thread.depth as depth | |
| from thread join tweets on tweets.in_reply_to_status_id = thread.id) | |
| select * from thread order by depth desc |
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
| class Safe extends String {} | |
| function safe(s) { | |
| if (!(s instanceof Safe)) { | |
| return new Safe(s); | |
| } else { | |
| return s; | |
| } | |
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| async def data( | |
| self, | |
| request, | |
| database, # Name of the database | |
| hash, # Hash component of the database URL (usually ignored) | |
| table, # Name of the table | |
| default_labels=False, # HTML views default to expanding all foreign key labels | |
| _next=None, | |
| _size=None, |
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
| { | |
| "title": "This is the title" | |
| } |