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
@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
"""
# get these fromhttps://apps.twitter.com/
$ export TWITTER_ACCESS_TOKEN_KEY=''
$ export TWITTER_ACCESS_TOKEN_SECRET=''
$ export TWITTER_CONSUMER_KEY=''
$ export TWITTER_CONSUMER_SECRET=''
$ pip install click tweepy
$ python count_hashtags.py '#djangocon' 2017-08-08
@jefftriplett
jefftriplett / .dockerignore
Last active November 20, 2022 21:44
How I use Docker and Compose
.*
!.coveragerc
!.env
!.pylintrc
@jefftriplett
jefftriplett / Makefile
Last active April 3, 2017 18:02
Toggl Desktop Makefile for nativefier + sips + iconutil
build: build_toggl_icon build_toggl
.PHONY: build_toggl
build_toggl:
@mkdir -p build/Toggl.iconset
@nativefier \
--overwrite \
--name Toggl \
--icon build/Toggl.icns \