Add-ons for django-forms-builder.
- NoneField (allows to use paragraphs in the django-forms-builder).
Installation
/* Inheritance */ | |
@mixin background-blue($color: blue) { | |
background-color: $color!important; | |
} | |
@mixin super-background($height: '300px', $color: white) { | |
height: $height; | |
@include background-blue($color); | |
} |
""" | |
Django's filter_horizontal/filter_vertical functionality in FeinCMS widgets | |
""" | |
from django.db import models | |
from feincms.admin.item_editor import FeinCMSInline | |
class PartyWidgetInlines(FeinCMSInline): | |
filter_horizontal = ['drinks', 'snacks'] |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
// http://stevenlevithan.com/demo/parseuri/js/assets/parseuri.js | |
// parseUri 1.2.2 | |
// (c) Steven Levithan <stevenlevithan.com> | |
// MIT License | |
function parseUri (str) { | |
var o = parseUri.options, | |
m = o.parser[o.strictMode ? "strict" : "loose"].exec(str), | |
uri = {}, | |
i = 14; |
/** | |
* PHP-like print_r() equivalent for JavaScript Object | |
* | |
* @author Faisalman <fyzlman@gmail.com> | |
* @license http://www.opensource.org/licenses/mit-license.php | |
* @link http://gist.github.com/879208 | |
*/ | |
var print_r = function (obj, t) { | |
// define tab spacing |
from pgpass_helper import read_pgpass | |
DATABASES = { | |
'default': read_pgpass('zupr'), | |
} |
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
def get_pages_range(total_pages_number, display_pages_number, | |
current_page_number): | |
""" | |
Generate x number of pages to display out of the total number of pages and | |
current page number. | |
:param int total_pages_number: Total number of pages. | |
:param int display_pages_number: Number of pages to display. | |
:param int current_page_number: Current page number. | |
:return iterable: |
/** | |
* Generate x number of pages to display out of the total number of pages and | |
* current page number. | |
* | |
* @param {Integer} totalPagesNumber: Total number of pages. | |
* @param {Integer} displayPagesNumber: Number of pages to display. | |
* @param {Integer} currentPageNumber: Current page number. | |
* @return {Array}: | |
*/ | |
function getPagesRange(totalPagesNumber, displayPagesNumber, currentPageNumber) { |