Skip to content

Instantly share code, notes, and snippets.

View jakobloekke's full-sized avatar

Jakob Løkke Madsen jakobloekke

View GitHub Profile
@jakobloekke
jakobloekke / Gruntfile.js
Created June 11, 2014 13:20
Yeoman connect mod-rewrite for Angular html5 routing
connect: {
options: {
port: 9000,
// Change this to '0.0.0.0' to access the server from outside.
hostname: '0.0.0.0',
middleware: function (connect, options) {
var middlewares = [];
var directory = options.directory || options.base[options.base.length - 1];
// enable Angular's HTML5 mode
@jakobloekke
jakobloekke / ng sprintf filter
Created November 4, 2013 14:25
Angularjs sprintf-style filter for interpolating text with values.
app.filter('sprintf', function() {
function parse(str) {
var args = [].slice.call(arguments, 1),
i = 0;
return str.replace(/%s/g, function() {
return args[i++];
});
}
@import "compass/css3/shared";
// NOTE:
// All mixins for the 2009 spec have been written assuming they'll be fed property values that
// correspond to the standard spec. Some mixins can be fed values from the 2009 spec, but don't
// rely on it. The `legacy-order` mixin will increment the value fed to it because the 2009
// `box-ordinal-group` property begins indexing at 1, while the modern `order` property begins
// indexing at 0.
// if `true`, the 2009 properties will be emitted as part of the normal mixin call
@jakobloekke
jakobloekke / _position-absolute-and-centered.scss
Created July 11, 2013 11:26
Sass mixin for positioning an element absolutely and centering it in its' container.
@mixin position-absolute-and-centered {
position: absolute;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
}