Skip to content

Instantly share code, notes, and snippets.

@lewisnyman
lewisnyman / gist:5651296
Created May 26, 2013 00:22
template_preprocess_html
/**
* Prepares variables for HTML document templates.
*
* Default template: html.html.twig.
*
* @param array $variables
* An associative array containing:
* - page: A render element representing the page.
*
* @see system_elements()
@lewisnyman
lewisnyman / Handlebars.idsafe
Last active December 14, 2015 05:49
A Handlebars helper for making a string HTML ID safe
Handlebars.registerHelper('idsafe', function(str) {
str = str.replace(/ /g , "-");
return str.toLowerCase();
});
@lewisnyman
lewisnyman / gist:2782134
Created May 24, 2012 15:10
Recreating the jQuery animation speed syntax for CSS animations using LESS
.animation-duration(@time) {
-webkit-animation-duration: @time;
-moz-animation-duration: @time;
-ms-animation-duration: @time;
-o-animation-duration: @time;
animation-duration: @time;
}
.animation-duration(@time) when (@time = fast) {
-webkit-animation-duration: 0.25s;