Skip to content

Instantly share code, notes, and snippets.

@bmease
bmease / gist:3813550
Created October 1, 2012 18:29
When trying to parse underscore templates with lxml.html it is dropping the underscore variable tags.
>>> import lxml.html
>>> content = "<html><%= SoftwareName %></html>"
>>> doc = lxml.html.fromstring(content)
>>> lxml.html.tostring(doc)
'<html></html>'
@bmease
bmease / gist:2820857
Created May 28, 2012 19:41
got rid of factory
# views.py
def add_tip(request):
if request.method == "POST":
formset = AddTipForm(request.POST)
if formset.is_valid():
formset.save()
else:
formset = AddTipForm()
@bmease
bmease / gist:2820527
Created May 28, 2012 18:29
Example formset
def liquid_comment_add(request, liquid_id):
liquid = get_object_or_404(Liquid, pk=liquid_id)
if request.method == "POST":
formset = CommentForm(request.POST)
if formset.is_valid():
liquid.comments.create(
http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html
- git checkout -b NUMBER_BRANCH_DESCRIPTION
- git commit // Multiple times
- git rebase -i origin/master // Compress down all the commits into a single one. Pick first line, squash rest
- git checkout master
- git merge NUMBER_BRANCH_DESCRIPTION
- git push origin master // Send everything back to github
- git branch -d NUMBER_BRANCH_DESCRIPTION