Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
if [ ! -f tags ];
then
ctags `find -iname '*.py'`
fi
export DJANGO_SETTINGS_MODULE=settings
gvim -geometry 128x38 $@
class Event(models.Model):
title = models.CharField(_('title'), max_length=255)
slug = models.SlugField(_('slug'))
description = models.TextField(_('description'))
# more code
class EventMetadata(models.Model):
event = models.ForeignKey(Event, verbose_name=_('event'),
related_name='metadata')
# more code
from django import template # to handle templates variables and context
register = template.Library() # register our template tags to be able to use them in our templates
from events import models # to get the models of our app
class EventMetadataListNode(template.Node):
def __init__(self, event_pk, context_var):
self.context_var = context_var # new var we are going to create
self.event_pk = template.Variable(event_pk) # the pk, get from the template "context" as a variable

(This is the text of the keynote I gave at Startup Riot 2009. Will update when video becomes available.)

Hi everyone, I’m Chris Wanstrath, and I’m one of the co-founders of GitHub.

GitHub, if you haven’t heard of it, has been described as “Facebook for developers.” Which is great when talking about GitHub as a website, but not so great when describing GitHub as a business. In fact, I think we’re the polar opposite of Facebook as a business: we’re small, never took investment, and actually make money. Some have even called us successful.

Which I’ve always wondered about. Success is very vague, right? Probably even relative. How do you define it?

After thinking for a while I came up with two criteria. The first is profitability. We employ four people full time, one person part time, have thousands of paying customers, and are still growing. In fact, our rate of growth is increasing – which means January was our best month so far, and February is looking pretty damn good.

<class 'django.core.exceptions.ImproperlyConfigured'> Python 2.5.2: /usr/bin/python
Sat Mar 14 04:26:13 2009
A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
/home/igor/dev/jaikuengine/.google_appengine/google/appengine/tools/dev_appserver.py in _HandleRequest(self=<google.appengine.tools.dev_appserver.DevAppServerRequestHandler instance at 0x99150ec>)
2709 infile,
2710 outfile,
2711 base_env_dict=env_dict)
2712 finally:
2713 self.module_manager.UpdateModuleFileModificationTimes()
Index: google/appengine/tools/dev_appserver.py
===================================================================
--- google/appengine/tools/dev_appserver.py (revision 41)
+++ google/appengine/tools/dev_appserver.py (working copy)
@@ -877,10 +877,10 @@
normcase=normcase):
relative_filename = logical_filename[len(FakeFile._root_path):]
- if FakeFile._skip_files.match(relative_filename):
- logging.warning('Blocking access to skipped file "%s"',
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
Chromium Dev Build
This is an in-progress build of Chromium on Linux. The following significant chunks of functionality are known to be missing:
Plugins, including Flash (so no YouTube, Hulu, etc.)
Printing
Complex text
Complex tab dragging
Gears support
Other parts of the browser are notably incomplete, poorly tuned and broken. User beware!
#!/usr/bin/env python
d1 = {'a': 1}
d2 = {'a': 1, 'b': 2}
l = [d1, d2, d1, d2]
for i in l:
i.pop('b', None)
print l
#!/usr/bin/env ruby
d1 = {'a' => 1}
d2 = {'a' => 1, 'b' => 2}
l = [d1, d2, d1, d2]
l.each do |i|
i.delete('b')
end