Manage git
repositories, provide access to them over SSH,
with tight access control and not needing shell accounts.
Note
Documentation is still lacking, and non-default configurations
#!/usr/bin/env python | |
# | |
# some bits stolen from Travis Cline's http://github.com/traviscline/git-branchdescriptions | |
# | |
import os | |
import re | |
import sys | |
from subprocess import Popen, PIPE |
# in ~/.gitconfig | |
[alias] | |
svnpull = !git stash && git svn rebase && git stash pop | |
svnpush = !git stash && git svn dcommit && git stash pop |
<li class="formrow formrow_{{ field.name }}{% if errors %} has_errors{% endif %}{% if not field.field.required %} optional{% else %} required{% endif %}"> | |
<label for="{{ field.auto_id }}">{{ field.label }}{% if not field.field.required %}<em> (optional)</em>{% endif %}</label> | |
{{ errors }} | |
{{ field }} | |
<small class="help_text">{{ help_text }}</small>{{ hiddenfields }} | |
</li> |
@register.filter | |
def exclude_fields(form, field_names): | |
""" | |
Returns the fields of a Form excluding the named fields. Usage: | |
{% for field in form|exclude_fields:"field1,field2,field3" %} | |
""" | |
fields = [] | |
if isinstance(form, BaseForm): | |
field_names = field_names.split(',') | |
for field in form.fields: |
javascript:void(function(){var%20i,a,s;a=document.getElementsByTagName('link');for(i=0;i%3Ca.length;i++){s=a[i];if(s.rel.toLowerCase().indexOf('stylesheet')%3E=0&&s.href)%20{var%20h=s.href.replace(/(&|%5C?)forceReload=\d+/,'');s.href=h+(h.indexOf('?')%3E=0?'&':'?')+'forceReload='+(new%20Date().valueOf())}}})(); |
""" | |
I have data like this. | |
I want to uniquify it based in the url. I have written code that works. | |
But it just seems gross. Is there a straightforward way to do this that I'm missing? | |
""" | |
embed_list = [ | |
{ |
tweet = Tweet() # new django object | |
tweet.content = item.content, | |
tweet.save() | |
tweet.content == "('%s',)" % item.content # True | |
# Don't accidentally end your lines with commas kids. |
The legendary #django-social
channel was once a lovely place of vibrant, cheerful discussion. I miss that.
This experimental channel is a place for off-topic, positive conversation. IRC is a great place to bitch and vent, but #positivepython
is not the place for it.
Feel free to invite anyone that you feel should be a part of the group. We want to be selective, not exclusive.