Skip to content

Instantly share code, notes, and snippets.

View huffmanks's full-sized avatar
🐇

Kevin Huffman huffmanks

🐇
View GitHub Profile
/*
* @title Character or word limit for textarea
* @desc Pick one and remove the other. Will not work together.
* @note Add maxlength attribute to textarea for character limit.
* @html <textarea id="message" maxlength="250"></textarea>
*/
window.addEventListener('DOMContentLoaded', () => { // For development environment testing
const wordMax = 250
const message = document.querySelector('#message')
/*
* @title Get all emails from a string
* @desc Puts every email into an array
*/
const text = 'This email was sent to someone@example.com by "Example News Services" &lt;news@example.com&gt;. Unsubscribe from email sent by Example News Services.'
const regexp = /([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+)/gim
const getEmails = (text) => {
/*
* @title Responsive grid columns
*/
/* Equal size grid items */
.el {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
gap: 20px;
}
/*
* @title Responsive table
* <table class="table-vertical">
* <tbody>
* <tr>
* <td>10:30 a.m.</td>
* <td>Session 1</td>
* </tr>
* ...
* </tbody>
<!--
* @title Filter times
* @desc Shows times available based on date
-->
<div>
<label for="interviewDate">Interview Dates/Times</label>
<select name="interviewDate" id="interviewDate" tabindex="-1">
<option value="" disabled="disabled" selected="selected">Select One</option>
<option value="Thursday, March 17">Thursday, March 17</option>

Upgrading Node env for MacOS

Setup npm permissions

sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}

Check global packages

  • npm list -g --depth 0

Reset local and pull

git reset --hard && git pull

OR

git stash && git pull && git stash pop
<!--
* @title Video background blur
* @desc Shows a background of the video on the sides if screen is larger than 1200px
-->
<!-- CSS -->
<style>
.video-container {
display: flex;
justify-content: center;