This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const styleEl = document.createElement('style') | |
styleEl.setAttribute('id', '_unique-id-outline-styles') | |
document.head.appendChild(styleEl) | |
// Inject outline preventing styles only for non-keyboard users | |
document.addEventListener('mousedown', () => { | |
styleEl.innerHTML = 'a,a:focus,button,button:focus,input,input:focus,textarea,textarea:focus,div:focus {outline:none}' | |
}) | |
document.addEventListener('keydown', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Usage: | |
* | |
* document.getElementById('app').serializeWithStyles() | |
* | |
* Credits go to https://stackoverflow.com/a/6310120/2803743 | |
*/ | |
Element.prototype.serializeWithStyles = (function () { | |
// Mapping between tag names and css default values lookup tables. This allows to exclude default values in the result. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GLOBAL CONFIGURATIONS | |
# ------------------------------------------------------------------- | |
# See https://github.com/jigish/slate/wiki/Global-Configs | |
config defaultToCurrentScreen true | |
config secondsBeforeRepeat 0.4 | |
config secondsBetweenRepeat 0.1 | |
config keyboardLayout "qwerty" | |
config nudgePercentOf screenSize | |
config resizePercentOf screenSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const nums = [3, 5, 6, 82, 1, 4, 3, 5, 82] | |
const result = nums.reduce((tally, amt) => { | |
tally[amt] ? tally[amt]++ : tally[amt] = 1 | |
return tally | |
}, {}) | |
console.log(result) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
( | |
export PKG=eslint-config-airbnb; | |
npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default (bytes) => { | |
const thresh = 1024; | |
if (Math.abs(bytes) < thresh) { | |
return bytes + ' B'; | |
} | |
const units = ['kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; | |
let u = -1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
let battery; | |
function toTime(sec) { | |
sec = parseInt(sec, 10) | |
let hours = Math.floor(sec / 3600) | |
let minutes = Math.floor((sec - (hours * 3600)) / 60) | |
let seconds = sec - (hours * 3600) - (minutes * 60) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if lte IE 9]> | |
<div class="legacy-warning"> | |
<div class="container"> | |
Seems like your browser is quite outdated. | |
Why not <a href="http://browsehappy.com/">upgrade to a modern one</a> | |
for free and improve your experience? | |
</div> | |
</div> | |
<![endif]--> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the Domain variable | |
export DOMAIN=NAME_OF_THE_DOMAIN | |
# Pull the docker image for certbot: | |
docker pull deliverous/certbot | |
# Obtain the certificates | |
docker run -it --rm -v /home/$(whoami)/vue-people/nginx/certs:/etc/letsencrypt:rw -v /home/$(whoami)/vue-people/nginx/certs-data:/data/letsencrypt:rw deliverous/certbot certonly --webroot --webroot-path=/data/letsencrypt -d $DOMAIN | |
# copy the certbot certs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.4.25) | |
// Compass (v1.0.3) | |
// ---- | |
$spaceamounts: (auto, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 80, 100); | |
$sides: ( | |
t: top, | |
b: bottom, | |
l: left, |