This file contains 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
/*! = $rembase: 14px | |
-------------------------------------------------------------- | |
* hmtl { font-size: 87.5%; } | |
* body { font-size: 14px; font-size: 1rem; line-height: 1; } | |
* 4px 0.28571429rem | |
* 8px 0.571428571rem | |
* 12px 0.857142857rem | |
* 13px 0.928571429rem | |
* 14px 1rem | |
* 16px 1.142857143rem |
This file contains 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
/* HTML | |
<p id="text_element">I am the text that the button will allow you to copy.</p> | |
<button onclick="copyToClipboard('text_element')"> | |
Copy | |
</button> | |
*/ | |
function copyToClipboard(elementId) { | |
// Create an auxiliary hidden input. | |
// Reason: The hidden aux input will act as a temporary container for our code to select via highlighting and copying since it's easier to do it on an input element. |
This file contains 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
Created by Eric Liang | |
https://www.eric-liang.com | |
Root Domain Matcher | |
/(https:\/\/|http:\/\/)?((www.)?([a-z\-]+.))?(([a-z\-]+)(?:\.\w+)+)/i | |
- Supports with or without http, https, or www. in the front of a domain name. | |
- Supports long segmented subdomains. | |
- Supports long suffix domain extensions (e.g. .co.uk). | |
- Supports any domain roots (e.g. .com, .net, .io, .club, etc.) |
This file contains 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
// List All Globally Installed NPM Packages on Operating System | |
npm list -g | |
npm list -g --depth 0 | |
> By adding "--depth 0", you avoid printing out the globally installed packages' dependencies. | |
// Update NPM on Windows | |
npm install -g npm |
This file contains 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
// Decodes a JWT with JavaScript | |
function jwtDecoder(token) { | |
// 1. Split and Target the Payload Portion of the JWT Token String | |
// 2. atob() to Decode the JWT's Base64 Encoded String into Readable JSON String | |
// 3. Convert JSON String to parsable JSON Object | |
return JSON.parse(atob(token.split('.')[1])); | |
} |