Skip to content

Instantly share code, notes, and snippets.

View gorangajic's full-sized avatar

Goran Gajic gorangajic

View GitHub Profile
@gorangajic
gorangajic / slugify.bash
Last active April 4, 2022 23:11 — forked from srdjanmarjanovic/slugify.bash
Useful script for naming branches for Git flow
#!/bin/bash
slugify() {
type="$1"
title="$2"
max_length="${3:-150}"
slug="$({
tr '[A-Z]' '[a-z]' | tr -cs '[[:alnum:]]' '-'
} <<< "$title")"