This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git show HEAD | |
error: inflate: data stream error (incorrect header check) | |
error: corrupt loose object 'd8f69614ed296c2c033ba4a6a558d4c2cc76fe63' | |
fatal: object d8f69614ed296c2c033ba4a6a558d4c2cc76fe63 is corrupted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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"` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.location !== window.top.location) | |
window.top.location = window.location; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# znc - irc bouncer | |
description "IRC bouncer." | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
exec znc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ foobar }}{# <- Nothing #} | |
{% if foobar %} | |
{% load wowzers %}{# <- Still throws an error #} | |
{% endif %} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |