Skip to content

Instantly share code, notes, and snippets.

View benrowe's full-sized avatar
😀
building things!

Ben Rowe benrowe

😀
building things!
View GitHub Profile
@benrowe
benrowe / slugify.js
Created November 24, 2015 00:07 — forked from mathewbyrne/slugify.js
Javascript Slugify
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
}
@benrowe
benrowe / scss-pseudo-empty-spinner.scss
Created November 17, 2015 23:36
Create a loading spinner using font-awesome when an element is empty
/**
* Example usage
* .container {
* @extends %empty-spinner;
* }
}
*/
%empty-spinner {
// empty