Skip to content

Instantly share code, notes, and snippets.

View benspaulding's full-sized avatar

Ben Spaulding benspaulding

View GitHub Profile
@benspaulding
benspaulding / models.py
Created June 16, 2009 02:22
Asking for some QuerySet help
from django.db import models
class ThingManager(models.Manager):
"""A manager for public Thing objects."""
def get_query_set(self):
return super(ThingManager, self).get_query_set() # How can I
# get a QuerySet that returns all Thing objects that have at least
# one related Piece object whose is_public attr is True?
$ git show HEAD
error: inflate: data stream error (incorrect header check)
error: corrupt loose object 'd8f69614ed296c2c033ba4a6a558d4c2cc76fe63'
fatal: object d8f69614ed296c2c033ba4a6a558d4c2cc76fe63 is corrupted
/* Fix Redmine issue table issue.
This issue is only an issue with Webkit. Issue.
Something to do with the avatar float and the
table width … uhh … issue. So, one could say this
is a Webkit issue. :)
*/
div.issue.details table[width="100%"] {
width: 85% !important;
}
@benspaulding
benspaulding / restart-bowtie.scpt
Created January 5, 2010 18:28
AppleScript that quits and relaunches Bowtie.
(*
AppleScript that quits and relaunches Bowtie. Bowtie has some
issues on Mac OS 10.6 and frequently needs restarted.
*)
set bowtieApp to application "Bowtie"
tell bowtieApp to quit
try
tell bowtieApp to run
@benspaulding
benspaulding / update-chromium.sh
Created January 14, 2010 21:13
Script to update Mac Chromium to the latest build.
#!/bin/bash
# Script to update Mac Chromium to the latest build.
# Personally, I drop this in my ~/Library/Scripts dir and run in from the
# Script menu item in the menu bar.
# NOTE: Chromium must not be running when this is run.
export APP_DIR="$HOME/Applications/Browsers"
export LATEST_BUILD=`curl --silent "http://build.chromium.org/buildbot/snapshots/chromium-rel-mac/LATEST"`
if (window.location !== window.top.location)
window.top.location = window.location;
@benspaulding
benspaulding / znc.conf
Created March 2, 2010 19:16
Upstart config for ZNC
# znc - irc bouncer
description "IRC bouncer."
start on runlevel [2345]
stop on runlevel [!2345]
respawn
exec znc
{{ foobar }}{# <- Nothing #}
{% if foobar %}
{% load wowzers %}{# <- Still throws an error #}
{% endif %}
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>Logic block test</title>
<h1>Logic block test</h1>
<p>It appears to me that template tags within “skipped” logic blocks are
actually evaluated. The code below throws an error when the either of the
<code>load</code> or <code>firstof</code> statements is uncommented.
Environment:
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.1.3 pre-alpha
Python Version: 2.6.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',