Skip to content

Instantly share code, notes, and snippets.

View jefftriplett's full-sized avatar
Living the dream

Jeff Triplett jefftriplett

Living the dream
View GitHub Profile
image: docker:latest
services:
- docker:dind
- postgres:latest
stages:
- build
- test
- release
# 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 October 27, 2018 15:44
Using Python 3, selenium, and headless chrome ala chromedriver to capture website screenshots
"""
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 August 22, 2018 21:46
DjangoCon US talk rename/shaping
import click
import frontmatter
import maya
from pathlib import Path
from slugify import slugify
@click.command()
@click.option('--max-length', default=40)
$ 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 18:49
Tool for generating a daily standup Toggl summary
from standup.cli import cli
if __name__ == '__main__':
cli()

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 November 10, 2017 17:25
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.
# 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