Skip to content

Instantly share code, notes, and snippets.

Sean Bleier sebleier

Block or report user

Report or block sebleier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View #lawrence.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sebleier
sebleier / gist:2891440
Created Jun 7, 2012 — forked from hay/gist:1351230
Enterprisify your Java Class Names!
View gist:2891440
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
View gist:1473587

Big-Q Notation

Big-Q notation is exactly the same as Big-O notation, except for the understanding that the constant multiplier for the asymptotic bound function is greater.

For example Big-O is defined as:

f(x) <= C * g(x)

Big-Q notation could be defined as:

@sebleier
sebleier / gist:1127937
Created Aug 5, 2011
This is how I kinda wished django migrations would work.
View gist:1127937
$ git checkout master
Already on 'master'
$ django-admin.py migrate
Error: Cannot migrate in a dirty state
$ git commit -am "Added migration to remove blog entry's pub_month and pub_day fields."
$ django-admin.py tag_migration add_column_to_foo # tags a migration identifier using git-tag
$ django-admin.py migrate
last known sha: c39168d21bb27754737a1036a50f57687cf6ae56
new migrations found between c39168..HEAD:
@sebleier
sebleier / nav_footer
Created Jun 16, 2011 — forked from anonymous/nav_footer
New navigation footer
View nav_footer
View gist:663612
>>> class Foo(object):
... a = {}
... b = 'bar'
...
... f = Foo()
... f.a['animal'] = "monkey"
... f.bar = 'not bar'
... g = Foo()
... print g.a, g.b
{'animal': 'monkey'} bar
View redis-server-for-init.d-startup
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
View gist:185731
class WSGIHandlerWrapper(WSGIHandler):
def __init__(self):
settings.configure(DEBUG_PROPAGATE_EXCEPTIONS=True)
super(WSGIHandlerWrapper, self).__init__()
def handle_uncaught_exception(self, request, resolver, exc_info):
try:
super(WSGIHandlerWrapper, self).handle_uncaught_exception(request, resolver, exc_info)
except Exception, e:
# do something
You can’t perform that action at this time.