Skip to content

Instantly share code, notes, and snippets.

View Bronskiy's full-sized avatar
💭
Seeking a position as a Full Stack, Frontend, Backend Developer

Nikolay Bronskiy Bronskiy

💭
Seeking a position as a Full Stack, Frontend, Backend Developer
View GitHub Profile
@Bronskiy
Bronskiy / mysqlStringToSlug
Last active November 19, 2021 20:42
MySQL to convert a string into a slug
LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM('My String'), ':', ''), ')', ''), '(', ''), ',', ''), '%', '') , '@', ''), '#', ''), '=', '-'), '^', ''), '+', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) AS `post_name`
@Bronskiy
Bronskiy / mysqlCyrillicStringToSlug
Last active November 21, 2021 16:17
MySQL to convert cyrillic string(Russian Alphabet) into a slug
REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(LOWER(TRIM('My String')), 'а', 'a'), 'б', 'b'), 'в', 'v'), 'г', 'g'), 'д', 'd'), 'е', 'e'), 'ё', 'e'), 'ж', 'j'), 'з', 'z'), 'и', 'i'), 'й', 'j'), 'к', 'k'), 'л', 'l'), 'м', 'm'), 'н', 'n'), 'о', 'o'), 'п', 'p'), 'р', 'r'), 'с', 's'), 'т', 't'), 'у', 'u'), 'ф', 'f'), 'х', 'h'), 'ц', 'c'), 'ч', 'ch'), 'ш', 'sh'), 'щ', 'sht'), 'ъ', 'y'), 'ы', 'i'), 'э', 'e'), 'ь', 'i'), 'ю', 'u'), 'я', 'ja') AS `post_name`