Skip to content

Instantly share code, notes, and snippets.

Max Beatty maxbeatty

Block or report user

Report or block maxbeatty

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
maxbeatty / hoc.js
Last active Sep 25, 2017
Trying to pass a React component in `getInitialProps` to a higher order component in next.js
View hoc.js
import React from "react";
export default function MainLayout(Child) {
return class MainLayoutComponent extends React.Component {
static getInitialProps(context) {
return Child.getInitialProps(context);
render() {
maxbeatty / lambda.js
Created Aug 22, 2017
using node-postgres (`pg`) in AWS Lambda
View lambda.js
import λ from "apex.js";
import { Pool } from "pg";
// connection details inherited from environment
const pool = new Pool({
max: 1,
min: 0,
idleTimeoutMillis: 120000,
connectionTimeoutMillis: 10000
maxbeatty / index.js
Created Jul 18, 2017
zeit/micro w/ sequelize
View index.js
const Sequelize = require("sequelize");
const sequelize = new Sequelize(
host: process.env.DB_HOST,
dialect: "mysql"
maxbeatty / b.js
Created Mar 5, 2017
AWS Lambda module caching anti-pattern
View b.js
var first = true;
module.exports = function () {
console.log(`first: ${first}`);
if (first) {
first = false;
maxbeatty /
Created Feb 1, 2017
example diff block in markdown

use diff to get fun red and green lines

- old
+ new

Keybase proof

I hereby claim:

  • I am maxbeatty on github.
  • I am maxbeatty ( on keybase.
  • I have a public key ASAj0U1E22K3wIaNOVtmMEMpV-5pX4F7hcPUOjCl58mg7Qo

To claim this, I am signing this object:

View .eslintrc
"extends": "future/react"
View app.js
assert = require('assert');
require('dotenv').config({path: 'production.env'});
assert.equal(process.env.DB_USER, 'root')
assert.equal(process.env.PORT, 80)
maxbeatty /
Created Mar 9, 2015
CoffeeScript Class Constructor Names
class Animal
constructor: ->
@noise = "BOOM"
speak: -> console.log @noise
class Dog extends Animal
constructor: ->
@noise = "BARK"
maxbeatty / bdc.js
Last active Aug 29, 2015 — forked from bendc/functional-inheritance.js
Constructor comparisons in performance and memory usage
View bdc.js
function car() {
return {
start: function() {
return "Engine on."
accelerate: function() {
return "Let's go!"
You can’t perform that action at this time.