Skip to content

Instantly share code, notes, and snippets.

View crgwbr's full-sized avatar

Craig Weber crgwbr

View GitHub Profile
@scottkellum
scottkellum / OOSass.md
Created March 24, 2012 15:53
OOCSS vs OOSass

OOCSS vs OOSass

note that this requires Sass 3.2 alpha or higher

OOCSS is awesome because it helps us organize our style sheets in clean and simple ways but it can be far too rigid for the new responsive web. How can we use preprocessors to preserve both flexibility and cleanliness of code? Can these objects be abstracted to our preprocessors?

Lets first take a look at three column widths in OOCSS to see how they compare.

CSS

@stephenmcd
stephenmcd / patch_extend_node.py
Created May 8, 2012 12:00
Allow circular Django template inheritance, so projects can both override and extend a reusable app's templates.
from django.template.loader_tags import ExtendsNode
def get_extends_parent(self, context):
"""
Patched onto Django's ``ExtendsNode.get_parent`` which is
responsible for loading the template to extend from with
the ``extends`` template tag.
This patch allows the template foo/bar.html to extend
foo/bar.html, given that there is another version of it that
@janaz
janaz / docker-overlay.sh
Created October 31, 2015 03:05
Create docker-machine with overlayfs
docker-machine create -d virtualbox --engine-storage-driver overlay --virtualbox-disk-size "50000" --virtualbox-memory "4096" overlay
@MarkusH
MarkusH / serial-to-identity.sql
Last active September 12, 2024 16:40
A script that outputs the raw SQL to convert Django's serial columns to identity columns.
WITH tab AS (
SELECT
a.attrelid::regclass::text AS t,
a.attname AS c,
pg_get_serial_sequence(a.attrelid::regclass::text, a.attname) AS s,
nextval(pg_get_serial_sequence(a.attrelid::regclass::text, a.attname)) AS v
FROM pg_attribute a
JOIN pg_class c ON c.oid = a.attrelid
WHERE
a.attrelid::regclass::text LIKE '%'