Skip to content

Instantly share code, notes, and snippets.

View esteele's full-sized avatar

Eric Steele esteele

View GitHub Profile
@eleddy
eleddy / commit_stats.py
Created June 6, 2013 16:41
Get stats for plone commits from ohloh
#! /usr/bin/python
from lxml import html
import datetime
import requests
from collections import defaultdict
def parse(html_string, impact=None):
"""
@pixelhandler
pixelhandler / pre-push.sh
Last active July 2, 2024 11:27
Git pre-push hook to prevent force pushing master branch
#!/bin/sh
# Called by "git push" after it has checked the remote status,
# but before anything has been pushed.
#
# If this script exits with a non-zero status nothing will be pushed.
#
# Steps to install, from the root directory of your repo...
# 1. Copy the file into your repo at `.git/hooks/pre-push`
# 2. Set executable permissions, run `chmod +x .git/hooks/pre-push`
@miohtama
miohtama / gist:5158737
Created March 14, 2013 04:11
Colorful Python logger
# -*- coding: utf-8 -*-
"""
Python logging tuned to extreme.
"""
__author__ = "Mikko Ohtamaa <mikko@opensourcehacker.com>"
__license__ = "MIT"
@omz
omz / Evernote Installer.py
Created February 27, 2013 15:07
Evernote Installer
# Simple installer script for using the Evernote SDK in Pythonista
#
# This script should be run from the root directory. In order to keep things
# tidy, it installs the module and all its dependencies in a directory named
# 'evernote-sdk'. In order to be able to import it, you have to add that to
# your import path, like this:
#
# import sys
# sys.path.append('evernote-sdk')
#
@mgedmin
mgedmin / check_manifest.py
Last active October 14, 2015 00:08
Beginning of a tool to check Python MANIFEST.in for completeness. MOVED TO https://github.com/mgedmin/check-manifest
#!/usr/bin/python
"""Check the MANIFEST.in file in a Python source package for completeness.
Here's the plan:
This script works by building a source distribution archive (by running
setup.py sdist), then checking the file list in the archive against the
file list in version control (Subversion, Git, Mercurial, Bazaar are
supported).
Since the first check can fail to catch missing MANIFEST.in entries when
@agnoster
agnoster / README.md
Last active July 13, 2024 19:26
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@esteele
esteele / _develop
Created August 19, 2012 19:18
zsh completion for mr.developer
#compdef develop
local subcmds
subcmds=(
'activate'
'checkout'
'deactivate'
'help'
'info'
@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:

@cjolly
cjolly / pg.sh
Last active July 25, 2022 20:16
Use homebrew to upgrade to postgres on OSX
newpg=9.6.1 # set to new PG version number
oldpg=`pg_config --version | cut -d' ' -f2`
# PG 96. upgrades the readline to v7, which breaks anything linked against readline v6, like ruby via ruby-build.
# I *think* this should prevent it from installing v7. But if weird shit happens with various rubies,
# you'll have to reinstall them.
brew pin readline
# Stop current Postgres server
brew services stop postgresql
@ttscoff
ttscoff / gitlogger.rb
Last active December 26, 2021 16:22
Archive marked git repositories daily commits to Day One and/or text file. Improved by @DivineDominion
#!/usr/bin/env ruby
require 'time'
require 'erb'
require 'cgi'
filename = "~/.gitlogger"
## File format, One per line
# Repo Name:/path/to/base
dayone = false # log to day one? (true or false)
textlog = false # "~/Dropbox/nvALT2.2/GitLogger.md" # set to false to disable