Skip to content

Instantly share code, notes, and snippets.

@opie4624
opie4624 / admin.py
Created August 14, 2008 19:51
Differences between old contrib.admin and new contrib.admin
from django.contrib import admin
from django.contrib.flatpages.models import FlatPage
from cms.search.models import SearchKeyword
#class SearchKeywordAdmin(admin.ModelAdmin):
# """Provide the admin functions for the SearchKeyword model."""
# pass
class SearchKeywordInline(admin.StackedInline):
@opie4624
opie4624 / data.php
Created August 20, 2008 15:19
An attempt to record and graph the signal levels from my cable modem over time as a diagnostic tool.
<?php
header("Content-type: text/xml");
include('XmlWriter.class.php');
$data = file("/home/akraut/cablemodem/siglog.csv");
$max = array();
$min = array();
$ldata = array();
$dotx = $dorx = False;
@opie4624
opie4624 / README
Created December 19, 2008 01:16
Working through the "Practical Django Projects" book from Apress
External Packages/Sources
Tagging http://code.google.com/p/django-tagging/
Markdown https://sf.net/projects/python-markdown/
pydelicious http://code.google.com/p/pydelicious/
@opie4624
opie4624 / Solution.txt
Created January 10, 2009 05:15
Puzzles for Hackers
>>> from xorencdec import xorencdec
>>> xorencdec('creature_creature_creature',']VTYJQC]aGC]_PDJ[{RJ[EEMLA')
'>$18>$18>$18>$18>$18>$18>$'
>>> xorencdec('Smith','>$18')
'mIXLV'
@opie4624
opie4624 / gist:59645
Created February 6, 2009 22:04
A nice non-compete agreement
\documentclass[11pt]{article}
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
%\geometry{landscape} % Activate for for rotated page geometry
\usepackage[parfill]{parskip} % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\DeclareGraphicsRule{.tif}{png}{.png}{`convert #1 `dirname #1`/`basename #1 .tif`.png}
%\nopagenumbers
@opie4624
opie4624 / README
Created September 7, 2009 08:20
Make emacsclient an easy habit!
Set an environment variable called ALTERNATE_EDITOR to point to this script. Then get in the habit of using emacsclient always. This will fire up emacs and wait for the server to start then fire up the file passed in via emacs client.
Right now it only works if your emacs will come up on your window manager, because that's primarily how I use it.
-Opie
SICP
====
Book
----
http://mitpress.mit.edu/sicp/
Tutorial
--------
http://icampustutor.csail.mit.edu/6.001-public/tutor.cgi
@opie4624
opie4624 / calllater.py
Created January 26, 2010 22:45
Working through the Twisted book
#!/usr/bin/env python
# encoding: utf-8
"""
calllater.py
Created by Andrew Kraut on 2010-01-25.
"""
import sys
import os
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-python/setuptools/setuptools-0.6.8.ebuild,v 1.4 2009/11/08 16:54:19 arfrever Exp $
EAPI="2"
SUPPORT_PYTHON_ABIS="1"
inherit distutils eutils
MY_PN="distribute"
[Wed Mar 10 07:40:01 2010] [notice] Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8l Phusion_Passenger/2.2.9 PHP/5.2.11-pl0-gentoo configured -- resuming normal operations
[ pid=11617 file=ext/apache2/Hooks.cpp:727 time=2010-03-10 07:40:06.344 ]:
Unexpected error in mod_passenger: The ApplicationPool server unexpectedly closed the connection while we're reading a response for the 'get' command.
Backtrace:
(backtrace support disabled during compile time)
[Wed Mar 10 07:40:07 2010] [notice] child pid 11609 exit signal Segmentation fault (11)
[ pid=11618 file=ext/apache2/Hooks.cpp:727 time=2010-03-10 07:40:09.93 ]:
Unexpected error in mod_passenger: Could not connect to the ApplicationPool server: Broken pipe (32)
Backtrace: