Skip to content

Instantly share code, notes, and snippets.

View anthonybrown's full-sized avatar
🎯
Focusing

Tony Brown anthonybrown

🎯
Focusing
View GitHub Profile
@anthonybrown
anthonybrown / downscroller.coffee
Created May 25, 2019 05:03 — forked from zwily/downscroller.coffee
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
anthonybrown / ES2017-pull-streams.md
Created April 13, 2019 13:18 — forked from darsain/ES2017-pull-streams.md
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.

Features:

  • Built in backpressure.
  • Build in error propagation.
@anthonybrown
anthonybrown / lamp-stack-osx-virtualhostx.md
Created April 10, 2019 18:56 — forked from pwenzel/lamp-stack-osx-virtualhostx.md
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
@anthonybrown
anthonybrown / index.html
Created March 4, 2019 22:30
My Calculator App
<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 March 2, 2019 11:02 — forked from lhorie/longest-keyword-sequence.md
What's the longest keyword sequence in Javascript?
@anthonybrown
anthonybrown / createQueue.js
Last active December 4, 2018 21:01
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.
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 December 2, 2018 21:23
Using Array.from to compose dates
Array.from({ length: 12 }, (x, index) => (new Date(0, index).toLocaleString('us-EN', { month: '2-digit' })));
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 October 17, 2018 10:13
An example of a currying in JavaScript
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)));
};
};
@anthonybrown
anthonybrown / web-performance.md
Created October 10, 2018 12:59 — forked from stevekinney/web-performance.md
Web Performance Workshop

Web Performance

Requirements

Repositories