Skip to content

Instantly share code, notes, and snippets.

@mzbyszewska
mzbyszewska / reverseadmin.py
Last active June 21, 2018 16:32 — forked from ramusus/gist:4343464
Forked from ramusus: https://gist.github.com/ramusus/4343464 and changed to work in Django 1.6, changes tested for OneToOne relation only (original version for Django 1.1 at https://djangosnippets.org/snippets/2032/.)
'''
adminreverse from here http://djangosnippets.org/snippets/2032/
changed for working with ForeignKeys
'''
'''
reverseadmin
============
Module that makes django admin handle OneToOneFields in a better way.
A common use case for one-to-one relationships is to "embed" a model
@nk9
nk9 / largestFiles.py
Last active November 14, 2023 09:47
Python script to find the largest files in a git repository.
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Python script to find the largest files in a git repository.
# The general method is based on the script in this blog post:
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
#
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects.
#