older posts

Introducing Git-Goggles

Git-Goggles: A series of Git utilities to streamline working with remote branches and reviewing code.

The development team I am in at PBS has adopted a new methodology over the last few months that includes using Git, frequent (2 weeks) release cycles and rigorous code reviews. We spend a reasonable amount of time reviewing every iteration since every line of code gets critiqued by at least 2 members of the team before it gets pushed to production.

We also have a lot of branches. Since git makes branching so inexpensive and easy to manage, we use them to group tasks by functional area. We generally have in between 10 to 15 branches at once that regularly get merged into our master repo, which is the production code.

What is tricky in all this is keeping track of what code still needs to be reviewed versus what is good to go. We wanted a way to get both a nice visual, tabulated view of the state of our branches along with their status from a code review standpoint. It was to scratch that itch that our team lead, Nowell Strite, created git-goggles. The project was open sourced last week under the MIT license.

Here's a demonstration of git-goggles using a basic scenario that utilizes this type of workflow. The goal here is to push a new piece of code to a production repository, while making sure that it has been reviewed and that the branches are merged in.

First I create a new repo, a test file, and push it to github.

read more...
0 comments

New year's Python meme

pythonFollowing in Tyrek Ziade's footsteps:

1. What’s the coolest Python application, framework or library you have discovered in 2009 ?

I hate to be so unoriginal... Django. I had been mostly using Zope 2/3 and Grok for web development (the latter is actually pretty cool).  But starting to work for PBS I got my first taste of Django and I was able to really completely dive in. Incredibly happy with it, I really appreciate all of the core functionality as well as a lot of contrib (not so much comments though, seriously what happened there?) and I feel like I can just get up and running much more quickly than before with minimal aggravation.

Just because Django is such a boring answer, I'll mention a few other really cool Python libs:

read more...
0 comments

An easy way to forward your django feed to feedburner

feedburner trafficIf you are using Django's syndication framework and want an easy way to track subscribers, Feedburner is probably your best bet. Of course if you already have a substantial amount of subscribers you'll want to forward the old feed to the new feed so as not to lose them.

I did this last week for this site and it worked very well, so if anyone else is trying to accomplish the same thing here is how I went about it:

First, I added the feedburner URL in settings.py (replace the URL with your own):

FEEDBURNER = 'http://feeds.feedburner.com/teebescom/'

Then, in urls.py I changed the view being called for the feed from the standard syndication view to a custom wrapper around that view.

So before it was:

url(r'^(?P(rss|atom))/$', 'django.contrib.syndication.views.feed', {'feed_dict': feeds}),

And I changed it to:

url(r'^(?P(rss|atom))/$', 'blog.views.rss.feedburner', {'feed_dict': feeds}),

Last, I added a rss.py file in the blog.views package with the following contents:

from django.conf import settings
from django.contrib.syndication.views import feed
from django.http import HttpResponseRedirect

def feedburner(request, url, feed_dict):
    FEEDBURNER = getattr(settings, 'FEEDBURNER', None)
    if not FEEDBURNER or request.META['HTTP_USER_AGENT'].startswith('FeedBurner'):
        return feed(request, url, feed_dict)
    else:
        return HttpResponseRedirect(FEEDBURNER)

And that's it! that should be all you need.

Post a comment if you have any questions.

0 comments

Playing with Google's Closure JS library

google closure tools image

On Thursday, Google open-sourced several of its JavaScript building blocks: a compiler, a library and template extension. They've been released together as the Closure toolkit.

I was particularly interested in its JavaScript library, specifically the graphics engine that implements the W3C's Scalable Vector Graphics as well as the event listeners. So I threw together a very small interactive app to play with the parts I'm curious about:

read more...
7 comments

A power companion for your smartphone

Often find yourself on the run with your phone or your iPod running low and no time to stop and recharge? 

I just picked up (at Harris Teeter, of all places) this pretty awesome gizmo I had read about a few weeks ago on one of the gadget blogs and that pretty much solves exactly that problem: the Duracell Instant Usb Charger.

  • Costs $35 (that's what I paid at the store and what Amazon sells it at, but I remember reading it can be gotten for as low as $20... Either way, it's cheap).
  • Gave my iPhone 60% power back in just over an hour and a half.
  • Uses USB both to charge other devices and itself be recharged.
  • Starts giving power as soon as you plug it

Overall a very thoughtfully designed little device that is cheap, slick, and useful to boot.

0 comments