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 / Makefile
Last active June 16, 2020 01:55 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
.PHONY: help
# COLORS
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
RESET := $(shell tput -Txterm sgr0)
TARGET_MAX_CHAR_NUM=20
@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
}