Author Archives: kpd

Adding GIT branch to BASH prompt

Save this: https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh to ~/.git-prompt.sh Then add to ~/.bashrc: source ~/.git-prompt.sh GIT_PS1_SHOWCOLORHINTS=1 PROMPT_COMMAND='__git_ps1 "\# \w" ": "' yielding: 19 ~/proj/app (develop): Note: There are more options to show the status of files. See the .git-prompt.sh for info. Edit: This is … Continue reading

Posted in programming | Leave a comment

New Programming / Shell / Vim Font

Thanks to Chris Weisel for pointing out a great new font for shells and Vim. I usually check out “great new programming fonts” and am consistently disappointed. This one is different. It is similar to Bitstream Mono, but not as … Continue reading

Posted in programming | Leave a comment

Easy Erg – C++ Library for the Concept 2 Rowing Machine Released

I recently open-sourced some of my code. It’s a C++ library that wraps the API and provides an ‘Erg’ class. It currently it builds against an older version of the SDK – version 1.24 – and the current build system … Continue reading

Posted in indoor-rowing, programming, rowing | Leave a comment

New Rowing Series on Row-2K

Row2K has posted the first video of a new web series. This one is called ‘Gut Checks.’ It is a series of short interviews with national-caliber rowers interspersed with some great rowing video. “The one that sticks out to me … Continue reading

Posted in rowing | Tagged | Leave a comment

VI Joke

I have no idea where I found this. People don’t argue about editors as much as they used to. This joke was more relevant then. Two guys are sitting in a bar, and get talking. "What's you IQ?" one asks. … Continue reading

Posted in programming | Tagged , | Leave a comment

RESTful API Design

I just stumbled on Geert Jansen’s book ‘Thoughts on RESTful API Design.’ Here he has documented things he learned while designing the Red Hat Enterprise Virtualization API. The nice thing is that the source to the book is on github … Continue reading

Posted in programming | Tagged , | Leave a comment

Repeating Sections in a Django Template

I have a need to have multiple sections of name/value pairs with a header on some pages. Something like: <div class="row">     <div class="span6">         <div class="row"><div class="span3"><h2>History:</h2></div></div>         <div class="row"><div class="span2">Date added to fleet:</div><div class="span2">{{plane.dateAddedToFleet}}</div></div>         <div class="row"><div class="span2">Total Flight Time:</div><div class="span2">{{plane.totalFlightTime|asTime}}</div></div>         <div … Continue reading

Posted in Django, Python | 8 Comments

Rate limiting with django-ratelimit

I was playing around with James Socol’s django-ratelimit tonight. It provides a decorator to rate-limit view functions. Very nice! I wanted to use it for login blocking, and some minor changes helped this out. My forked version of django-ratelimit is … Continue reading

Posted in Django, Python | Leave a comment

Custom Tag to Render Avatar in Django Userena

Here is a simple custom tag to render a users avatar (‘mugshot’) when using Django Userena. It optionally takes width and or height in pixels. Place the following code in /templatetags/my_app_tags.py: your_app/     models.py     templatetags/         __init__.py         my_app_tags.py from django import template … Continue reading

Posted in Django, Python | Leave a comment

Mothballed Software

We all probably have mothballed software – projects that didn’t go very far. This was one of mine, a rowing game!

Posted in programming, rowing | Leave a comment