Skip to content

Instantly share code, notes, and snippets.

Want to work with me? Let's talk @revsys

Jeff Triplett jefftriplett

Want to work with me? Let's talk @revsys
Block or report user

Report or block jefftriplett

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Dockerfile
FROM python:3.7
COPY hello.py /
CMD [ "python", "/hello.py" ]
@jefftriplett
jefftriplett / modd.conf
Last active Jul 4, 2019
Django + Modd + Maybe Docker
View modd.conf
# 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
View .gitlab-ci.yml
image: docker:latest
services:
- docker:dind
- postgres:latest
stages:
- build
- test
- release
View Dockerfile
# 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@...>"
@jefftriplett
jefftriplett / capture.py
Created Oct 27, 2018
Using Python 3, selenium, and headless chrome ala chromedriver to capture website screenshots
View capture.py
"""
To install:
# python requirements
$ pip install click selenium
# for headless chrome
$ brew install chromedriver
To use:
$ python capture.py https://revsys.com revsys.png
@jefftriplett
jefftriplett / process.py
Last active Aug 22, 2018
DjangoCon US talk rename/shaping
View process.py
import click
import frontmatter
import maya
from pathlib import Path
from slugify import slugify
@click.command()
@click.option('--max-length', default=40)
View pg_hba.conf.md
$ cat /usr/local/var/postgres/pg_hba.conf
# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     trust
# IPv4 local connections:
host    all             all             127.0.0.1/32            trust
# IPv6 local connections:
host    all             all             ::1/128                 trust
@jefftriplett
jefftriplett / __init__.py
Last active May 18, 2018
Tool for generating a daily standup Toggl summary
View __init__.py
from standup.cli import cli
if __name__ == '__main__':
cli()
View keto-coffee-recipe.md

My "Keto Coffee" or "Bulletproof Coffee" recipe

My typical "keto coffee" or "bulletproof coffee" recipe. Since Bulletproof is a brand, I use cheap coffee. I'd encourage you to start with what you have already and make it your own. You don't have to have MCT Oil for instance. A friend of mine who'd been in Keto told me about it, and I just took his recommendation as is.

Please note: If you aren't used to high fat in your diet (most of us are not), start slow with 1 Tbsp of oil and work up a teaspoon at a time if your body is ok with that. It's common for some people to experience stomach issues when starting. I also would not exceed 2 Tbps. of oil, or you might want to make sure you are near a bathroom and not on a long commute to work. This coffee can get "things moving" quickly if you aren't used to two tablespoons of oil in the morning. I'd recommend working up from one tablespoon and going from there.

  • Starbucks Morning Joe your favorite coffee (I get Morning Joe because it's cheap $8 a bag
@jefftriplett
jefftriplett / chrome_headless_screenshot.py
Last active Nov 10, 2017
This might help anyone struggling with webkit2png which is outdated and broken on a lot of websites. This python script uses headless chrome and only scratches the surface of what is possible. Thanks to https://gist.github.com/rverton/d07a2232f4c0e1c2b9894e9bdb4fa6cf for inspiration.
View chrome_headless_screenshot.py
# Adapted from: https://gist.github.com/rverton/d07a2232f4c0e1c2b9894e9bdb4fa6cf
#
# Install:
# chromedriver from https://sites.google.com/a/chromium.org/chromedriver/downloads
# Python deps (pip or pipenv): `pipenv install click selenium`
#
# To use:
# python chrome_headless_screenshot.py --height=1280 https://jefftriplett.com/ screenshot.png
import click
You can’t perform that action at this time.