Skip to content

Instantly share code, notes, and snippets.

View ydaniv's full-sized avatar

Yehonatan Daniv ydaniv

View GitHub Profile
import os
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
DEBUG = True
FIXTURES = (
'dev/sites',
'dev/objects',
'pages',
@ydaniv
ydaniv / mozGetMatchedCSSRules.js
Created July 2, 2012 12:32
A Gecko only polyfill for Webkit's window.getMatchedCSSRules
// polyfill window.getMatchedCSSRules() in FireFox 6+
if ( typeof window.getMatchedCSSRules !== 'function' ) {
var ELEMENT_RE = /[\w-]+/g,
ID_RE = /#[\w-]+/g,
CLASS_RE = /\.[\w-]+/g,
ATTR_RE = /\[[^\]]+\]/g,
// :not() pseudo-class does not add to specificity, but its content does as if it was outside it
PSEUDO_CLASSES_RE = /\:(?!not)[\w-]+(\(.*\))?/g,
PSEUDO_ELEMENTS_RE = /\:\:?(after|before|first-letter|first-line|selection)/g;
// convert an array-like object to array
@ydaniv
ydaniv / supr.js
Created July 10, 2011 06:43
simple wrapper for the ES5 Object.create mechanism and a function that fetches overridden methods from the prototype chain.
/*
* Copyright (C) 2011 Yehonatan Daniv <maggotfish@gmail.com>
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
*
* 0. You just DO WHAT THE FUCK YOU WANT TO.
*
* supr.js is a simple wrapper for the Object.create mechanism of ES5,
* to ease the creation of objects via the Create function.