Skip to content

Instantly share code, notes, and snippets.

View rassie's full-sized avatar

Nikolai Prokoschenko rassie

  • Nürnberg, Germany
View GitHub Profile
@rassie
rassie / urls.py
Created July 30, 2012 13:09
Django view for applying webassets bundles per file
# prefix option in the bundle is set to '__assets__'
from django.views.generic.simple import redirect_to
urlpatterns = patterns('',
url(r'^__assets__/static/(?P<url>.*\.css)$', 'views.filter_css'),
url(r'^__assets__/static/(?P<url>.*\.less)$', 'views.filter_css'),
(r'^__assets__/static/(?P<rest>.*)$', redirect_to, {'url': '/static/%(rest)s'} ),
)
@rassie
rassie / README.md
Last active December 27, 2015 21:19 — forked from mbostock/.block
Smooth slider with snap-in on round values

By customizing the display of D3’s brush component, you can make a single-handle slider. Or, by using custom resize handles, you can make a two-handled slider.

Updated from mbostock's original Smooth Slider to including snapping on round values.

@rassie
rassie / camelToKebabCase.jsonnet
Created August 12, 2022 09:02
camelCase to kebab-case for `jsonnet`
function camelToKebabCase(x) = std.asciiLower(std.native('regexSubst')('([A-Z])', x, '-$1'));