Skip to content

Instantly share code, notes, and snippets.

View gazpachoking's full-sized avatar

Chase Sterling gazpachoking

View GitHub Profile
@amcclosky
amcclosky / pendulum_type.py
Created January 15, 2021 23:54
A sqlalchemy column type that wraps a Pendulum datetime
# custom sqlalchemy column type for a pendulum datetime - https://pendulum.eustace.io/
from datetime import datetime
import pendulum
import sqlalchemy as sa
from sqlalchemy.types import TypeDecorator as _TypeDecorator
from sqlalchemy_utils.types.scalar_coercible import ScalarCoercible as _ScalarCoercible
@gazpachoking
gazpachoking / trac2down.py
Last active August 29, 2015 13:57 — forked from sgk/trac2down.py
Converts a trac wiki dump from WikiFormatting to GFM suitable for use on a github wiki
"""Usage: trac2down <trac wiki dump path>"""
from __future__ import unicode_literals
import codecs
import os
import re
import sys
def convert_wiki_link(link):
if link.startswith('wiki:'):
@cbsmith
cbsmith / cleanup.py
Last active December 16, 2015 16:59
Python code that traverses one or more directories, removing any orphaned .pyc's.
"""Traverses the directory tree deleting any .pyc's who do not have a source .py.
Helpful when switching between revisions with source control."""
from os.path import join
from os import walk, unlink
import re
import sys
PYTHON_RE = re.compile(R'^(.*\.py)(c)?$')
global count
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: