Power DVD shortcut keys
PowerDVD Ultra Keyboard Shortcuts
XBMC Launcher
http://code.google.com/p/xbmc-launcher/wiki/Main
Intel Board
http://www.ncix.com/products/?sku=32612&vpn=BOXDG45FC&manufacture=Intel
Rambling about Django, Python, Ansible and sometimes PHP and Wordpress. I enjoy talking about all technologies, and offer help when I can.
Thursday, December 31, 2009
Wednesday, December 30, 2009
Thursday, December 24, 2009
Tuesday, December 22, 2009
Monday, December 21, 2009
Source interface with Python and urllib2 - Stack Overflow
A monkey patch to change your source interface with python
Source interface with Python and urllib2
import socket
true_socket = socket.socket
def bound_socket(*a, **k):
sock = true_socket(*a, **k)
sock.bind((sourceIP, 0))
return sock
socket.socket = bound_socket
Tuesday, December 15, 2009
SplitSettings - Django
No sure why they don't set this up by default but the best way to setup your media and template paths is:
DIRNAME = os.path.abspath(os.path.dirname(__file__))
DATABASE_NAME = os.path.join(DIRNAME, 'project.db')
MEDIA_ROOT = os.path.join(DIRNAME,'media')
TEMPLATE_DIRS = (
os.path.join(DIRNAME,'templates'),
)
SplitSettings - Django - Trac
Inlines support for Django generic views
Django generic views are missing one major feature, inline forms. This class is a drop in that adds the functionality.
Wad of Stuff: Inlines support for Django generic views
Sunday, December 13, 2009
How to use *args and **kwargs in Python
A good example of kwargs and args
How to use *args and **kwargs in Python
Saturday, December 12, 2009
Lazy choices in Django form
A cool library that django has the doesn't seem to be documented very well
from django.utils.functional import lazy
class CarSearchForm(forms.Form):
# lots of fields like this
bodystyle = forms.ChoiceField(choices=lazy(bodystyle_choices, tuple)())
Lazy choices in Django form - Stack Overflow
Thursday, December 10, 2009
Simple Python ping method
def ping(host):
result = subprocess.call(["ping","-c","1",host],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
if result == 0:
return True
elif result == 1:
raise Exception('Host not found')
elif result == 2:
raise Exception('Ping timed out')
useage:
try:
ping('192.168.100.100')
except Exception:
print "Ping error"
raise
Wednesday, December 09, 2009
Django/Eclipse Debug
This is a sweet setup for Django development with eclipse to use debug to run manage.py runserver
YouTube - Django/Eclipse Debug
search and replace with regular expressions in eclipse
Found a great way to do dynamic search and replace in eclipse.
search and replace with regular expressions in eclipse
Subscribe to:
Comments (Atom)