Skip to content

Instantly share code, notes, and snippets.

😻
meow

Bailey Stoner monokrome

😻
meow
Block or report user

Report or block monokrome

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 gist:1140511
!!! 5
//if lt IE 7 <html class="no-js ie6 oldie" lang="en">
//if IE 7 <html class="no-js ie7 oldie" lang="en">
//if IE 8 <html class="no-js ie8 oldie" lang="en">
// [if gt IE 8] <!
html(class="no-js", lang="en")
// <!--<![endif]
head
View gist:1147437
script
window.jQuery || document.write("<script src=/lib/jquery-1.6.2.min.js></script>");
View gist:1147482
from django.contrib.gis.db import models
from django.contrib.auth.models import User
from django.conf import settings
auto_approve_comments = getattr(settings, 'COMMENTS_AUTO_APPROVE', True)
class Place(models.Model):
""" For maintaining a database of different places. """
location = models.PointField()
View gist:1147593
script='window.jQuery || document.write("<script src=/lib/jquery-1.6.2.min.js></script>");'
View gist:1147646
class BlogForm(models.Model):
display_name = models.CharField(max_length=32)
form_class = models.CharField(max_length=128)
# Implement a way to import `form_class` and render the form.
class BlogPost(models.Model):
# Basic blog stuff.
form = models.ForeignKey(BlogForm)
View models.py
class ResponseType(models.Model):
# If you want people to rate others' responses, for instance. This
# provides context on why this specific pattern is useful. Also,
# consider aggregate functions over multiple data types.
rating = models.PositiveIntegerField()
class StringResponseType(ResponseType):
value = models.CharField(max_length=128)
class BooleanResponseType(ResponseType):
@monokrome
monokrome / gist:1179657
Created Aug 29, 2011
Header comments from HTML5 boilerplate.
View gist:1179657
!!! 5
//if lt IE 7 <html class="no-js ie6 oldie" lang="en">
//if IE 7 <html class="no-js ie7 oldie" lang="en">
//if IE 8 <html class="no-js ie8 oldie" lang="en">
// [if gt IE 8] <!
html(class="no-js", lang="en")
// <![endif]
head
@monokrome
monokrome / gist:1193405
Created Sep 4, 2011
Connect Middleware
View gist:1193405
function five_middleware (req, res, next) {
req.five = 5;
next();
}
View gist:1193487
(function ($) {
// jQuery here.
})(jQuery);
@monokrome
monokrome / wtf.rb
Created Sep 8, 2011
Why I hate Ruby.
View wtf.rb
end
end
end
end
# wtf.
You can’t perform that action at this time.