Skip to content

Instantly share code, notes, and snippets.

@ez90
ez90 / curl.md
Created September 9, 2019 09:25 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@ez90
ez90 / slug-function.sql
Created September 10, 2018 10:06
SQL Slug function
// Credits:
// - http://stackoverflow.com/questions/5409831/mysql-stored-function-to-create-a-slug
// - https://gist.github.com/jareis/847e7e1523e4ea8f8676
DELIMITER ;;
DROP FUNCTION IF EXISTS `slugify`;;
CREATE FUNCTION `slugify`(dirty_string varchar(255)) RETURNS varchar(255) CHARSET utf8
DETERMINISTIC
BEGIN
#Email validation
/^(\w[-._+\w]*\w@\w[-._\w]*\w\.\w{2,3})$/
#Postcodes
##Australian postcodes:
/^[0-9]{4}/
##Brazilian postcodes
/^[0-9]{2}\.[0-9]{3}-[0-9]{3}$/
##Canadian postcodes
/^[a-zA-Z]\d{1}[a-zA-Z](\-| |)\d{1}[a-zA-Z]\d{1}$/
##US postal codes