Skip to content

Instantly share code, notes, and snippets.

@kez
kez / slugify.sql
Created May 13, 2019 14:50 — forked from ianks/slugify.sql
Generating Slugs in Postgres
CREATE EXTENSION IF NOT EXISTS "unaccent"
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"lowercase" AS (
@markolson
markolson / run.sh
Created May 10, 2012 15:35
Webdriver/Capybara runner.
if [ -f /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome ]; then
browser="chrome"
elif [ -f /Applications/Firefox.app/Contents/MacOS/firefox ]; then
browser="firefox"
else
echo "Neither Chrome nor Firefox found. Install one."
exit
fi
echo "This opens a screen session with several windows. Once testing is complete, exit all of them to return to this terminal"
DIR="$( cd "$( dirname "$0" )" && pwd )"