Skip to content

Instantly share code, notes, and snippets.

@remy
remy / Makefile
Last active March 15, 2022 00:57
The Makefile I'm using to compile .less file changes *when* the changes occur. Full write up: https://remysharp.com/makefile
# when you run `make` alone, run the `css` rule (at the
# bottom of this makefile)
all: css
# .PHONY is a special command, that allows you not to
# require physical files as the target (allowing us to
# use the `all` rule as the default target).
.PHONY: all
# replace all .less files with .css extension and cache
@paulsmith
paulsmith / verbatim_templatetag.py
Created October 25, 2011 19:03 — forked from ericflo/verbatim_templatetag.py
verbatim Django template tag
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
function test(x) {
return x === 1;
}
if (test(2)) {
print("no")
}
/* AST