Skip to content

Instantly share code, notes, and snippets.

View scarletcafe's full-sized avatar
🎯
Focusing

Devon R scarletcafe

🎯
Focusing
View GitHub Profile
@mezhgano
mezhgano / playwright_save_mhtml.py
Created May 1, 2023 14:58
Save .mhtml web archive using playwright
from playwright.sync_api import sync_playwright
def save_mhtml(path: str, text: str):
with open(path, mode='w', encoding='UTF-8', newline='\n') as file:
file.write(text)
def save_page(url: str, path: str):
with sync_playwright() as playwright:
browser = playwright.chromium.launch(headless=False)
# Unix (Terminal)
open -a "Google Chrome" --args --disable-gpu-vsync --disable-frame-rate-limit
# Windows (Command prompt)
start chrome --args --disable-gpu-vsync --disable-frame-rate-limit
@cecilemuller
cecilemuller / 2019-https-localhost.md
Last active November 14, 2024 06:21
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@freakboy3742
freakboy3742 / gist:c699f293c9b5e77ef289
Last active December 26, 2022 00:32
Douglas Adams on jokes

From: Salmon of Doubt by Douglas Adams

There’s always a moment when you start to fall out of love, whether it’s with a person or an idea or a cause, even if it’s one you only narrate to yourself years after the event: a tiny thing, a wrong word, a false note, which means that things can never be quite the same again. For me it was hearing a stand-up comedian make the following observation: “These scientists, eh? They’re so stupid! You know those black-box flight recorders they put on aeroplanes? And you know they’re meant to be indestructible?

It’s always the thing that doesn’t get smashed? So why don’t they make the planes out of the same stuff?” The audience roared with laughter at how stupid scientists were, couldn’t think their way out of a paper bag, but I sat feeling uncomfortable. Was I just being pedantic to feel that the joke didn’t really work because flight recorders are made out of titanium and that if you made planes out of titanium rather than aluminium, they’d be far too heavy to get off the