When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:
main {
max-width: 38rem;
padding: 2rem;
margin: auto;
}
from sqlalchemy import create_engine | |
from sqlalchemy.orm import Session | |
from myapp.models import BaseModel | |
import pytest | |
@pytest.fixture(scope="session") | |
def engine(): | |
return create_engine("postgresql://localhost/test_database") |
import os | |
from a2wsgi import WSGIMiddleware | |
from django.core.wsgi import get_wsgi_application | |
from django.views import debug as django_views_debug | |
from django_extensions.management.technical_response import ( | |
null_technical_500_response, | |
) | |
from werkzeug.debug import DebuggedApplication | |
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings") |
import asyncio | |
import psycopg2 | |
# dbname should be the same for the notifying process | |
conn = psycopg2.connect(host="localhost", dbname="example", user="example", password="example") | |
conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT) | |
cursor = conn.cursor() | |
cursor.execute(f"LISTEN match_updates;") |
#!/bin/bash | |
function f() { | |
sleep "$1" | |
echo "$1" | |
} | |
while [ -n "$1" ] | |
do | |
f $1 & | |
shift | |
done |
import asyncio | |
import sys | |
from typing import Optional | |
import asyncssh | |
import httpx | |
class MySSHTCPSession(asyncssh.SSHTCPSession): | |
def __init__(self): |
@main.command() | |
def routes(): | |
from mainweb import app | |
sorted_rules = sorted(app.url_map.iter_rules(), key=lambda x: x.rule) | |
max_rule = max(len(rule.rule) for rule in sorted_rules) | |
max_ep = max(len(rule.endpoint) for rule in sorted_rules) | |
max_meth = max(len(', '.join(rule.methods)) for rule in sorted_rules) |
[Unit] | |
Description = Mount disk | |
Before = local-fs-pre.target | |
[Service] | |
User = root | |
Type = oneshot | |
RemainAfterExit = yes | |
ExecStart = /usr/local/sbin/mount-disk.sh |
import { inflateRaw, deflateRaw } from "pako"; | |
// https://en.wikipedia.org/wiki/Run-length_encoding | |
const Z_RLE = 3; | |
class BitArray { | |
constructor(bitSize) { | |
const remainder = Math.min(1, bitSize % 8); | |
const byteSize = Math.floor(bitSize / 8) + remainder; | |
const buffer = new ArrayBuffer(byteSize); |
import requests | |
r = requests.get("http://download.thinkbroadband.com/10MB.zip", | |
cookies={'cookie1': 'working'} | |
) | |
open('10MB.zip', 'wb').write(r.content) |