Skip to content

Instantly share code, notes, and snippets.


Tony Brown anthonybrown

View GitHub Profile
anthonybrown /
Created May 16, 2022 20:34 — forked from lmcneel/
How to remove node_modules after they have been added to a repo

How to remove node_modules

Create a .gitignore file

  1. Check for an existing .gitignore file in the project directory
ls -a
anthonybrown /
Created February 16, 2021 19:29 — forked from bvaughn/
How to use profiling in production mode for react-dom
anthonybrown / Enhance.js
Created October 16, 2020 10:28 — forked from sebmarkbage/Enhance.js
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
componentDidMount() {
this.setState({ data: 'Hello' });
render() {
anthonybrown / twittermute.txt
Created January 24, 2020 16:04 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here:
anthonybrown /
Created July 20, 2019 16:40 — forked from ljharb/
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.


JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

anthonybrown / create-react-component.js
Created June 18, 2019 12:17 — forked from rastating/create-react-component.js
A script to create the boilerplate code for a new React.js component with a [Jest] spec file
View create-react-component.js
#! /usr/bin/env node
# Usage: node create-react-component.js ComponentName
# Note: If a `components` directory does not exist in the current working directory, nothing will be created
const fs = require('fs')
const path = require('path')
const componentName = process.argv[2]
const componentPath = path.join(



  • ✏️ method changes this.
  • 🔒 method does not change this.


  • concat(...items: Array): T[] 🔒 ES3
anthonybrown / flux.js
Created May 30, 2019 09:34 — forked from acdlite/flux.js
A Redux-like Flux implementation in <75 lines of code
View flux.js
* Basic proof of concept.
* - Hot reloadable
* - Stateless stores
* - Stores and action creators interoperable with Redux.
import React, { Component } from 'react';
export default function dispatch(store, atom, action) {
anthonybrown /
Created May 25, 2019 05:03 — forked from zwily/
Puts a big annoying arrow in your Limechat window when you're not scrolled down, like a dummy. (requires limescripts)
## Puts a big annoying arrow in your window when you're not scrolled down, like a dummy
scrollAlert = $("<div id='scrolldown-arrow'>⬇</div>")
showing = false
body = $ document.body
win = $ window
doc = $ document