thoughtherder
-
RMV : Cut Rubies with ease!
Tuesday, October 26, 2010 12:26 p.m.
RVM is a command line tool which allows us to easily install, manage and work with multiple ruby environments from interpreters to sets of gems.
-
Flow Control in npm
Monday, October 25, 2010 6:22 p.m.
@izs waxes on flow control patterns used in npm, his package manager for node.
He seems to have released the code as a slide-flow-control library, which can be yours thusly,
npm install slide. -
Canada by Train
Monday, October 25, 2010 11:29 a.m.
Recently relocated from Montreal, PQ to Victoria, BC. Some shots from the train.






-
The Ruby Programming Language
Monday, October 25, 2010 11:20 a.m.
Dated article about Ruby by the language’s author, Yukihiro Matsumoto. Kind of a nice introduction.
-
Sammy.js
Monday, October 25, 2010 11:06 a.m.
Sammy is a tiny javascript framework built on top of jQuery. It’s RESTful Evented JavaScript.
I wrote an introduction to sammy.js a while back, circa version 0.5.4.
-
A Successful Git Branching Model
Saturday, October 23, 2010 5:45 p.m.
The article describes a successful branching model, which the author later turned into a set of extensions to git. I’ve started using
git-flowon a few projects and so far it’s been nice. Since it’s just a few conveniences, I should probably get better at the real commands before getting lazy. If you’re interested and using homebrew:brew install git-flowOr, you can get the source of git-flow at github.
-
Dive Into HTML5
Tuesday, October 19, 2010 12:17 a.m.
By Mark Pilgrim, with illustrations from the public domain.
-
An Implausibly Illustrated Introduction to HTML5 Web Workers
Monday, August 30, 2010 11:49 p.m.
-
TCP and the Lower Bound of Web Performance
Saturday, July 17, 2010 11:48 p.m.
-
Type Polymorphism in Django
Monday, May 24, 2010 11:15 p.m.
models.py
from django.db import models from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes import generic related_object_limits = {'model__in': ('specificitem1', \ 'specificitem2')} class RelatedItem(models.Model): content_type = models.ForeignKey(ContentType, \ related_name='main_object', \ limit_choices_to=related_object_limits) object_id = models.PositiveIntegerField() content_object = \ generic.GenericForeignKey('content_type', \ 'object_id') related_content_type = \ models.ForeignKey(ContentType, \ related_name='related_object', \ limit_choices_to=related_object_limits) related_object_id = models.PositiveIntegerField() related_object = \ generic.GenericForeignKey('related_content_type', \ 'related_object_id') class Item(models.Model): name = models.CharField(max_length=100) slug = models.SlugField(unique=True) related = generic.GenericRelation(RelatedItem, \ content_type_field='content_type', \ object_id_field='object_id') def __unicode__(self): return self.name class Meta: abstract = True class SpecificItem1(Item): property1 = models.CharField(max_length=100) class SpecificItem2(Item): property2 = models.CharField(max_length=100)admin.py
from django.contrib import admin from django.contrib.contenttypes.generic \ import GenericTabularInline from models import SpecificItem1 class RelatedItemInline(GenericTabularInline): model = RelatedItem class SpecificItem1Admin(admin.ModelAdmin): list_display = ('name', 'slug') search_fields = ('name',) inlines = [RelatedItemInline,] admin.site.register(SpecificItem1, SpecificItem1Admin)
