This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2011 Yehonatan Daniv <[email protected]> | |
* | |
* 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__)) | |
DEBUG = True | |
FIXTURES = ( | |
'dev/sites', | |
'dev/objects', | |
'pages', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
// appDir : "use if creating a proper app according to RequireJS' conventions", | |
baseUrl : 'path/to/base', | |
// dir : "use if we're outputting a directory", | |
optimize : 'uglify', | |
paths : { | |
plugins : '../../lib', | |
mustache : '../../lib/mustache', | |
common : '../common', | |
ui : 'ui', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define([ | |
'spin' | |
], function (Spinner) { | |
return [ | |
function () { | |
return { | |
restrict: 'A', | |
scope : { | |
spinAction : '&spinAction', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############ | |
# Option A # | |
############ | |
class CategoryTestCase(RESTAPITestCase): | |
"""Tests Category API endpoints.""" | |
base_name = 'category' | |
user_factory = account_factories.Admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Create the virtual environment | |
mkvirtualenv openbudgets | |
# Link central project code directory to its virtual environment | |
setvirtualenvproject /home/vagrant/envs/openbudgets /home/vagrant/openbudgets | |
# Move to the root of central project code directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Assuming an implementation of a pub/sub system that provides publish() and subscribe() functions. | |
* Also assuming a Promises A+ implementation. | |
* | |
* In this way a publisher that requires some unknown subscriber to either accept or decline can | |
* publish an event that will pass a deferred object to any subscribed component that can either | |
* resolve or reject the promise. | |
* | |
* A nice example is some action button that requires a modal confirm dialog to prompt the user to | |
* either accept or decline the action. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import uuid | |
from django.db import models | |
from django.utils.encoding import force_text as force_unicode | |
class DefaultUUIDField(models.UUIDField): | |
def __init__(self, *args, **kwargs): | |
kwargs['blank'] = True | |
kwargs.setdefault('editable', False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Kampos, effects} from 'kampos'; | |
const target = document.querySelector('canvas'); | |
const media = document.querySelector('video'); | |
const hueSaturation = effects.hueSaturation(); | |
const kampos = new Kampos({target, effects: [hueSaturation]}); | |
hueSaturation.hue = 90; |
OlderNewer