Skip to content

Instantly share code, notes, and snippets.

@jcroft
jcroft / Cache settings
Created January 23, 2011 21:43
Using Django trunk with the python-memcache background, I can set the cache, but not get from it. But it's definitely setting, because you can see that the underlying memcache instance (cache._cache) is able to get -- it's just django's cache.get() method
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache',
'LOCATION': '127.0.0.1:11211',
'KEY_PREFIX': 'barstar_',
}
}
<?php
Print "Hello, World!";
?>
@jcroft
jcroft / django_settings.py
Created January 31, 2012 17:08
Preventing comment spam
COMMENTS_SECRET = 'any_old_string_you_like'
@jcroft
jcroft / example_page.html
Created February 1, 2012 09:55
First stab at a simple responsive/fluid grid system with fixed gutters
<!doctype html>
<head>
<meta charset="utf-8">
<title>Grid test</title>
<link rel="stylesheet" href="css/example.css">
</head>
<body>
<div id="wrapper">
@jcroft
jcroft / input.sass
Created February 6, 2012 21:51
What I really want in Sass: a syntax for doing media queries inside a selector or mixin...
// Typical grid column mixin..
=column($percent)
width: $percent
float: left
// Fancy new pseudo-selector syntax for media queries which would let my
// column from above switch to 100% when the window got narrower than 600px...
&@media only screen and (min-width: 600px)
width: 100%
@jcroft
jcroft / layout.sass
Created March 1, 2012 04:51
How easy responsive design can be with Sass
#content-wrapper
+container
#about
// Default (smallest screens)
+column(100%)
background-color: #ccc
// Respond to other screen widths
div#content-wrapper
+container
#left-sidebar
+column(25%)
#main-content
+column(50%)
#right-sidebar
div#content-wrapper
+container
#left-sidebar
+column(100%)
+respond-to(tablet-large)
width: 25%
#main-content
+column(100%)
@jcroft
jcroft / layout.sass
Created March 2, 2012 20:33
Example of using Sass media query bubbling
div#content-wrapper
+container
#left-sidebar
+column(100%)
@media only screen and (min-width : 768px)
width: 25%
#main-content
+column(100%)
@jcroft
jcroft / gist:2732742
Created May 19, 2012 23:19
Superconference predictions

Super conference predictions

Pac-12

Oregon Oregon State Washington Washington State Cal South Cal UCLA