Skip to content

Instantly share code, notes, and snippets.

View gomezcabo's full-sized avatar

Juan Gómez gomezcabo

  • Tenerife, España
View GitHub Profile
@gomezcabo
gomezcabo / auth.json
Created January 25, 2022 19:03 — forked from miguelmota/auth.json
AWS Cognito Identity authenticate using cURL
{
"AuthParameters" : {
"USERNAME" : "alice@example.com",
"PASSWORD" : "mysecret"
},
"AuthFlow" : "USER_PASSWORD_AUTH",
"ClientId" : "9..............."
}

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@gomezcabo
gomezcabo / storage-polyfill.js
Created March 28, 2019 09:38 — forked from ghinda/gist:6036998
local/session storage polyfill (@Rem's version + with support for opera mini)
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () {
var Storage = function (type) {
function createCookie(name, value, days) {
var date, expires;
if (days) {
date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
@gomezcabo
gomezcabo / slugify.js
Created March 14, 2019 10:31 — 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
}