Skip to content

Instantly share code, notes, and snippets.

Tony Brown anthonybrown

View GitHub Profile
@anthonybrown
anthonybrown / ES2017-pull-streams.md
Created Apr 13, 2019 — forked from darsain/ES2017-pull-streams.md
Better streaming interface for modern JavaScript.
View ES2017-pull-streams.md

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.

Features:

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

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
<html>
<link href='https://fonts.googleapis.com/css?family=Electrolize' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.1/css/font-awesome.min.css">
<head>
<title>Calculator App</title>
</head>
<body>
@anthonybrown
anthonybrown / longest-keyword-sequence.md
Created Mar 2, 2019 — forked from lhorie/longest-keyword-sequence.md
What's the longest keyword sequence in Javascript?
View longest-keyword-sequence.md
@anthonybrown
anthonybrown / createQueue.js
Last active Dec 4, 2018
Using a Queue to contain our data structure, use a queue. Create a function that returns our data in a plain old Object. A queue is a collection of items that obey's the principle of FIFO, first in, first out.
View createQueue.js
function createQueue() {
// store our queue
const queue = []
return {
// add or enqueue
enqueue(item) {
queue.unshift(item)
},
// remove or dequeue
@anthonybrown
anthonybrown / Array2-Digit.js
Last active Dec 2, 2018
Using Array.from to compose dates
View Array2-Digit.js
Array.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleString('us-EN', { month: '2-digit' })));
View App.js
import React, { Suspense, useState } from "react";
import { unstable_createResource as createResource } from "react-cache";
import {
Combobox,
ComboboxInput,
ComboboxList,
ComboboxOption
} from "./Combobox2.js";
function App({ tabIndex, navigate }) {
@anthonybrown
anthonybrown / currier.js
Created Oct 17, 2018
An example of a currying in JavaScript
View currier.js
var currier = function(fn) {
var args = Array.prototype.slice.call(arguments, 1);
return function() {
return fn.apply(this, args.concat(
Array.prototype.slice.call(arguments, 0)));
};
};
View web-performance.md

Web Performance

Requirements

Repositories

View react-firebase-setup.md

React && Firebase Workshop

Contact Information

Prequisite Setup

  • A recent version of Node.js
  • npm install -g create-react-app
You can’t perform that action at this time.