Skip to content

Instantly share code, notes, and snippets.

View andresgcarmona's full-sized avatar
🎯
Focusing

Andrés G. Carmona andresgcarmona

🎯
Focusing
View GitHub Profile
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=3356eb28a4f746ca1528)
* Config saved to config.json and https://gist.github.com/3356eb28a4f746ca1528
*/
/*!
* Bootstrap v3.3.5 (http://getbootstrap.com)
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
/*!
* Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=3356eb28a4f746ca1528)
* Config saved to config.json and https://gist.github.com/3356eb28a4f746ca1528
*/
@andresgcarmona
andresgcarmona / service-worker.js
Created September 13, 2020 14:47 — forked from jeffposnick/service-worker.js
Example of InjectManifest in Workbox v5
// Add any other logic here as needed.
import { CacheableResponsePlugin } from 'workbox-cacheable-response/CacheableResponsePlugin';
import { CacheFirst } from 'workbox-strategies/CacheFirst';
import { createHandlerForURL } from 'workbox-precaching/createHandlerForURL';
import { ExpirationPlugin } from 'workbox-expiration/ExpirationPlugin';
import { NavigationRoute } from 'workbox-routing/NavigationRoute';
import { precacheAndRoute } from 'workbox-precaching/precacheAndRoute';
import { registerRoute } from 'workbox-routing/registerRoute';
@andresgcarmona
andresgcarmona / contrast.coffee
Created July 25, 2020 19:34 — forked from lerouxb/contrast.coffee
The W3C's suggested color contrast algorithm
# http://www.w3.org/TR/AERT#color-contrast
getBrightness = (rgb) ->
sum = parseInt(rgb[0])*299 + parseInt(rgb[1])*587 + parseInt(rgb[2])*114
brightness = Math.round(sum / 1000) # 0 (dark) to 255 (light)
colorDifference = (a, b) ->
max = Math.max
min = Math.min
d0 = max(a[0], b[0]) - min(a[0], b[0])
<?php
return [
'GB' => '/^GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}$/',
'JE' => '/^JE\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/',
'GG' => '/^GY\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/',
'IM' => '/^IM\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}$/',
'US' => '/^\d{5}([ \-]\d{4})?$/',
'CA' => '/^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJ-NPRSTV-Z][ ]?\d[ABCEGHJ-NPRSTV-Z]\d$/',
'DE' => '/^\d{5}$/',
@andresgcarmona
andresgcarmona / Response.php
Created August 24, 2018 01:57 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
@andresgcarmona
andresgcarmona / git.migrate
Created December 1, 2017 20:15 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
.dummyclass {
display:none;
}
:root {
--version-content: "1.1";
}
/* Version Displayed */
.account:after {content: var(--version-content); color: rgba(255,255,255,0.2); font-size: 11px; font-weight: bold; position: absolute; bottom: 0; left: 149px; right: 0; opacity: 1;