This file contains hidden or 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 MODEL | |
class Item(models.Model): | |
title = models.CharField(max_length=128) | |
photo = models.ImageField(upload_to="photos/",null=True, blank=True,) | |
description = models.TextField(null=True, blank=True,) | |
section = models.ForeignKey(Section) | |
order = models.IntegerField(null=True, blank=True,) | |
creation_date = models.DateTimeField(auto_now_add=True) | |
last_modified = models.DateTimeField(auto_now=True) |
This file contains hidden or 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
; this annoyed me because it should have been simple but I fiddled with settings | |
; for quite some time. The -n is the important part though which causes bitlbee | |
; to not fork into the background. I tried several supervisord settings including | |
; pidproxy without any luck. | |
[program:bitlbee] | |
command=/usr/sbin/bitlbee -nv -c /etc/bitlbee/bitlbee.conf | |
user=bitlbee |
This file contains hidden or 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
[program:znc] | |
command=/usr/bin/znc -f --datadir=/home/znc/.znc | |
user=znc |
This file contains hidden or 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 | |
# this simply runs "django-admin.py test" every time it detects that a *.py | |
# file has changed. | |
watchmedo shell-command --patterns="*.py" --ignore-directories --recursive --command="django-admin.py test --noinput" project_name/ |
This file contains hidden or 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
""" | |
Author: Jeff Triplett | |
Based off: https://code.djangoproject.com/wiki/PaginatorTag | |
Thanks to Brent O'Connor for pointing it out. | |
""" | |
from django import template | |
register = template.Library() |
This file contains hidden or 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
import datetime | |
import pymongo | |
import simplejson | |
from pymongo.objectid import ObjectId | |
class DateTimeMongoEncoder(simplejson.JSONEncoder): | |
def default(self, obj): | |
if isinstance(obj, (datetime.date, datetime.datetime)): | |
return obj.strftime('%Y-%m-%dT%H:%M:%S') |
This file contains hidden or 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
(work-armstrong-plz)Jeff-Tripletts-MacBook-Pro:work-armstrong-plz jefftriplett$ pip install armstrong | |
Downloading/unpacking armstrong | |
Using download cache from /Users/jefftriplett/.pip/download_cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fa%2Farmstrong%2Farmstrong-11.09.0.alpha.2.tar.gz | |
Running setup.py egg_info for package armstrong | |
Downloading/unpacking armstrong.cli>=0.6.0 (from armstrong) | |
Using download cache from /Users/jefftriplett/.pip/download_cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fa%2Farmstrong.cli%2Farmstrong.cli-0.6.0.tar.gz | |
Running setup.py egg_info for package armstrong.cli | |
Downloading/unpacking armstrong.core.arm-access>=0.1.1 (from armstrong) | |
Using download cache from /Users/jefftriplett/.pip/download_cache/http%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2Fa%2Farmstrong.core.arm_access%2Farmstrong.core.arm_access-0.1.1.tar.gz | |
Running setup.py egg_info for package armstrong.core.arm-access |
This file contains hidden or 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
""" | |
pyhowl - Post to Howl (http://howlapp.com) | |
Copyright (c) 2011, Jeff Triplett | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright notice, |
This file contains hidden or 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
# saved from: http://pastie.org/private/bclbdgxzbkb1gs2jfqzehg | |
import sublime | |
import sublimeplugin | |
import subprocess | |
class RunExternalCommand(sublimeplugin.TextCommand): | |
""" | |
Runs an external command with the selected text, | |
which will then be replaced by the command output. |