- GitHub for code
- Render blueprint specified by render.yaml
- Postgres
- Redis
- Linked to GitHub repo
- Add environment variables for
PYTHON_VERISON=3.9.7
,ENVIRONMENT=live
, andSECRET_KEY
- Cloudflare for SSL and CNAME pointing to Render app domain
- Force SSL with a Cloudflare rule
- Namecheap for the domain
- Point nameservers to Cloudflare
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
twitter.com##[aria-label$="Trending now" i] | |
twitter.com##article [aria-label^="Recommended Topic" i]:upward(article) |
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/bin/env python | |
import argparse | |
import os | |
import subprocess | |
import sys | |
import time | |
# Required so we don't generate tons of logs during restore | |
disable_logging_sql = "ALTER USER postgres RESET pgaudit.log;" |
I got sick of writing the same Serializer & ModelViewSet classes over and over so I found and wrote some code to do it for me, and somehow it works! Please note that there are a lot of caveats to running an API like this and while this may work, I know there's A LOT of room for improvement, feel free to fork and help!
Import the router
module to your main sites urls.py file as the injection point like so...
Make sure to remove any other imports from other viewsets that you don't need that may conflict!
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
// service worker | |
self.addEventListener("install", (event) => { | |
event.waitUntil( | |
caches.open("{{ cache_key }}").then((cache) => | |
cache.addAll([ | |
// {% for asset in assets %} | |
"{{ asset }}", | |
// {% endfor %} | |
]) | |
) |
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
"""Find the earliest available version of a list of Python dependencies. | |
This takes dependencies on the command line (package names with or without | |
version specifiers), looks up each in PyPI, and outputs a new list of | |
dependencies that specify the earliest version in each range. | |
See https://twitter.com/simonw/status/1473441058667130881 for the reason for | |
this script. | |
Example: |
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
spec: | |
containers: | |
- | |
name: misc | |
image: gladiatr72/misc:util-21 | |
env: | |
- | |
name: POD_IP | |
valueFrom: | |
fieldRef: |
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
"""Back in my day, we only needed **one** command. 🧓""" | |
import runpy | |
import sys | |
def run(command): | |
sys.argv[0] = command | |
runpy.run_module(command, run_name="__main__") |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Single File Web Component</title> | |
<style> | |
body { | |
background-color: #eee; | |
font-family: Helvetica, sans-serif; | |
} |