Skip to content

Instantly share code, notes, and snippets.

Tony Brown anthonybrown

Block or report user

Report or block anthonybrown

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
anthonybrown / create-react-component.js
Last active Jun 18, 2019 — 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[] | T>): T[] 🔒 ES3
anthonybrown / flux.js
Created May 30, 2019 — 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 / myHigherOderFunction.js
Last active Jun 10, 2019
An example of functional programing using a higher order function
View myHigherOderFunction.js
let formatCurrency = function( currencySymbol, decimalSeparator ) {
return function( value ) {
let wholePart = Math.trunc(value / 100);
let fractionalPart = value % 100;
if ( fractionalPart < 10 ) fractionalPart = '0' + fractionalPart;
return `${currencySymbol}${wholePart}${decimalSeparator}${fractionalPart}`;
let formatter = formatCurrency( '$', '.' );
anthonybrown / vscode.json
Last active Jun 10, 2019
My current vscode settings as of May 2019
View vscode.json
// Place your settings in this file to overwrite the default settings
"window.zoomLevel": 1,
"editor.formatOnSave": true,
"editor.detectIndentation": true,
"editor.fontSize": 18,
// "editor.lightbulb.enabled": false,
"editor.parameterHints.enabled": false,
"editor.fontFamily": "Operator Mono",
"editor.fontLigatures": true,
anthonybrown /
Created May 25, 2019 — 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
anthonybrown /
Created Apr 13, 2019 — forked from darsain/
Better streaming interface for modern JavaScript.

Better streaming interface for modern JavaScript

Node streams have a lot of issues. Awkward to control backpressure, no error propagation, overcomplicated implementation impenetrable to any view source attempts, etc...

To solve this, here is an implementation of pull-streams in modern JS, using promises, async iterators, and for..await loops.


  • Built in backpressure.
  • Build in error propagation.
anthonybrown /
Created Apr 10, 2019 — forked from pwenzel/
LAMP stack on OSX with Homebrew, built-in Apache, multiple PHP versions, VirtualhostX optional

This guide shows how to set up a PHP and MySQL development environment using OSX's built-in Apache, using Homebrew to install necessary components. With this strategy, you can use different versions of PHP for certain virtual hosts.

VirtualHostX is a convenient way to manage development sites, but not required.

Install PHP and MySQL with Homebrew

brew update
brew install php56
brew install php56-mcrypt
brew install mysql
View index.html
<link href='' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="">
<title>Calculator App</title>
anthonybrown /
Created Mar 2, 2019 — forked from lhorie/
What's the longest keyword sequence in Javascript?
You can’t perform that action at this time.