Nick Lang

Programming Posts

Another Site Redesign

Posted by Nick Lang on Feb 15

So I wasn't a big fan of how my previous CSS skills left the site unusable on mobile devices. So, I decided to use a more responsive CSS framework, called Skeleton.

Now I know the site still looks like well Skeleton's default settings. Well I have a hard time thinking outside the box when it comes to making things look good.

Ideally I want a design that's clean, typographically pleasing, and easy to read. I don't want a lot of color and flashy bits.

So hopefully this will work better for the time being.

Also of note, I've updated the training link to actually display my training in grid form. I'm still working on a way to graph my data but that'll come.


2011 Lang Family Bowl Pool

Posted by Nick Lang on Dec 06

So for about 20+ years my family has had a bowl pool that friends and extended family have participated in. It started with my Papa, and was passed down to my uncle who took over ran ran it for years. He created a very slick excel spread sheet to tally picks and keep track of winners. But ultimately this was a time consuming effort on his part cause he had to make sure that people had the updated spread sheet, make sure that they had macros enabled on their computers, etc... For years this was actually pretty efficient and the standard way of doing things.

Well my uncle has finally had enough with running the bowl pool, and has passed the torch on to me. Being the python geek that I am, I decided to take this and turn it into a web app.

The concept is pretty ...


Run External Command in SublimeText2

Posted by Nick Lang on Sep 29

So, I've written my second SublimeText2 at the request of my friend Jeff Triplett. RunExternal is a simple command that will execute the currently highlighted text, try to execute it in a python subprocess, and replace the highlighted text with the output of the command.

In it's most simple state it will take something like this:

date 

And turn it into something like this:

Thu Sep 29 16:36:33 MDT 2011 

I'd like to see this have more functionality, something along the lines of http://manual.macromates.com/en/shell_commands

If any of you out there are sublimetext wizards and would like to help contribute to this. Or if you have any ideas on how to make this better please let me know!


Class Based Views, WTF? - Part 1

Posted by Nick Lang on Sep 17

So since Django 1.3 came out the new hotness has been Class Based Views. I remember taking a look at the documentation and thinking to myself this is fine and all, but I still don't quite understand what's going on. If you're like me I hope I can take my expereiences and translate them into something that's a little more helpful and you too can get up and running with CBV's.

What we are going to do is actually go through what it takes to convert a classic view to a CBV subclassed from django.views.generic.base.View. I think this will give the best starting point for understanding how a CBV actually works.

First lets look at a very simple, classic view:

from django.shortcuts import render_to_response from django.template import RequestContext from awesome_project.awesome_app.models import MyModel def awesome_view(request, *args, **kwargs): template = kwargs.pop('template', "mytemplate.html") object_list = MyModel.objects.filter(**kwargs) return render_to_response(template,{ 'object_list': object_list, }, RequestContext(request)) 
...

IRC and Github

Posted by Nick Lang on Sep 16

So you use github right? If not that's ok. I do.

Are you also like me and use IRC. Do you have an IRC room for you work or for a specific github project?

Well I just found this out (I know it's probably old news) but I'm hoping that this can be informative to people like me who live in remote sections of the mountains! You can have github post messages into your IRC room to notify the room of commits.

To set this up navigate to https://github.com/your_account_name/github_project_name/admin/hooks.

From here you can scroll down and click on IRC.

Next fill out the form according to the instructions under the form.

And voila! Github now notifies your room of all commits that get pushed to the repo!