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 frontmatter | |
import requests | |
import typer | |
def main(url: str): | |
request = requests.get(url) | |
post = frontmatter.loads("") | |
headers = request.headers | |
post["headers"] = {} |
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
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "httpx", | |
# "rich", | |
# "typer", | |
# ] | |
# /// | |
""" | |
$ uv run django-top-100.py |
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
[mypy] | |
python_version = 3.7 | |
ignore_missing_imports = True | |
plugins = | |
mypy_django_plugin.main, | |
mypy_drf_plugin.main | |
strict_optional = True | |
[mypy.plugins.django-stubs] | |
django_settings_module = "config.test_settings" |
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
name: CI | |
on: [push] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: |
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
# Update project requirements when requirements.txt changes. | |
requirements.txt { | |
prep +onchange: "pip install -U -r requirements.txt" | |
} | |
../.envrc { | |
prep +onchange: "direnv allow" | |
} | |
**/index.css **/tailwind.config.js { |
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 python:3.7 | |
COPY hello.py / | |
CMD [ "python", "/hello.py" ] |
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
# Run the test suite if a source or test file changes | |
**/tests/test_*.py { | |
# prep +onchange: pytest @dirmods | |
prep +onchange: pytest @mods | |
} | |
requirements.txt { | |
# prep +onchange: pytest @dirmods | |
prep +onchange: " | |
pip install -U -r 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
image: docker:latest | |
services: | |
- docker:dind | |
- postgres:latest | |
stages: | |
- build | |
- test | |
- release |
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
# Usage: | |
# Building | |
# docker build -t jefftriplett/pinboardbot . | |
# Running (no saved state) | |
# docker run -it \ | |
# jefftriplett/pinboardbot | |
# | |
FROM python:3.6-alpine as builder | |
LABEL maintainer "Jeff Triplett <jeff.triplett@...>" |
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
""" | |
To install: | |
# python requirements | |
$ pip install click selenium | |
# for headless chrome | |
$ brew install chromedriver | |
To use: | |
$ python capture.py https://revsys.com revsys.png |