Skip to content

Instantly share code, notes, and snippets.

View davep's full-sized avatar
👁️‍🗨️
Nothing like the eve of extinction to bring focus to the mind.

Dave Pearson davep

👁️‍🗨️
Nothing like the eve of extinction to bring focus to the mind.
View GitHub Profile
@davep
davep / macosx-configure-postfix-as-relay.md
Created April 14, 2022 21:14 — forked from loziju/macosx-configure-postfix-as-relay.md
Configure postfix as relay for OS X
@davep
davep / feedparser_django_datetime.py
Created August 1, 2019 13:24 — forked from yaph/feedparser_django_datetime.py
A snippet that shows how to convert a feedparser time.struct_time object to a Django datetime with timezone support.
from django.utils import timezone
import time
# feed = object from DB
# doc = parsed feedparser object
feed.updated_at = doc.feed.get('updated_parsed', timezone.now())
if isinstance(feed.updated_at, time.struct_time):
feed.updated_at = timezone.make_aware(
timezone.datetime(*feed.updated_at[:-3]),
@davep
davep / intersphinx_mappings.txt
Created June 4, 2019 12:02 — forked from bskinn/intersphinx_mappings.txt
Various intersphinx mappings
Python 3.5: ('https://docs.python.org/3.5', None)
NumPy [latest]: ('http://docs.scipy.org/doc/numpy/', None)
SciPy [latest]: ('http://docs.scipy.org/doc/scipy/reference', None)
matplotlib [latest]: ('http://matplotlib.org', None)
h5py [latest]: ('http://docs.h5py.org/en/latest/', None)
Sphinx [stable]: ('http://www.sphinx-doc.org/en/stable/', None)
Django [latest?]: ('http://docs.djangoproject.com/en/dev/', 'https://docs.djangoproject.com/en/dev/_objects/')
sarge [latest]: ('http://sarge.readthedocs.io/en/latest/', None)
attrs [stable]: ('http://www.attrs.org/en/stable/', None)
@davep
davep / zsh_to_fish.py
Created May 8, 2019 13:39 — forked from dvdbng/zsh_to_fish.py
Migrate zsh history to fish
import os
import re
def zsh_to_fish(cmd):
return (cmd.replace('&&', '; and ')
.replace('||', '; or '))
def is_valid_fish(cmd):
@davep
davep / GitCommitEmoji.md
Created April 19, 2018 08:14 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji