Skip to content

Instantly share code, notes, and snippets.

View theenoahmason's full-sized avatar
🎯
Focusing

Noah Mason theenoahmason

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am theenoahmason on github.
  • I am noahmason (https://keybase.io/noahmason) on keybase.
  • I have a public key ASBnF0LkWuJhsze34ElmalmN49eGjJm1iVZn5pcMLzYcVwo

To claim this, I am signing this object:

@theenoahmason
theenoahmason / utils.js
Created January 10, 2019 20:08
Cross Browser Copy To Clipboard function
// Must be called directly in a "short interaction event handler"
// like `click` or `mousedown`/`touchstart`. Cannot be triggered from
// an <a> anchor element, even if `e.preventDefault()` is called on the
// event. passed `input` must be an <input> of any type or a <textarea>.
export function copyToClipboard(input = null) {
if (! input || (['INPUT', 'TEXTAREA'].indexOf(input.tagName) === -1)) {
throw new Error('A Valid <input> or <textarea> HTML element must be passed as the first parameter.');
}
@theenoahmason
theenoahmason / coming-soon.html
Last active June 28, 2017 21:43
Gist Coming Soon
<!-- Coming Soon -->