Skip to content

Instantly share code, notes, and snippets.

View chasemccoy's full-sized avatar
💳
Working on product design systems at Stripe

Chase McCoy chasemccoy

💳
Working on product design systems at Stripe
View GitHub Profile
@johnsonjo4531
johnsonjo4531 / .editorconfig
Last active November 9, 2021 19:56
Tiny Testing Framework that allows async functions and test groups.
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@matthewp
matthewp / decorate-element.js
Last active April 23, 2020 07:57
decorate-element
function decorate(tag, template) {
customElements.define(tag, class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
let root = this.shadowRoot;
if(!root.firstChild) {
@jamesreggio
jamesreggio / react-forwardref-simple-example.js
Last active January 8, 2023 21:40
Simple example usage of React.forwardRef()
// EmailInput wraps an HTML `input` and adds some app-specific styling.
const EmailInput = React.forwardRef((props, ref) => (
<input ref={ref} {...props} type="email" className="AppEmailInput" />
));
class App extends Component {
emailRef = React.createRef();
render() {
return (
@biilmann
biilmann / readme.md
Created October 14, 2015 22:07
Quick Guide to Private NPM Modules on Netlify

Using NPM Private Modules on Netlify

Create a .npmrc file for your project like this:

//registry.npmjs.org/:_authToken=${NPM_TOKEN}

Then find your token inside the ~/.npmrc file in your home folder and set it as an NPM_TOKEN environment variable through netlify's admin UI.