Skip to content

Instantly share code, notes, and snippets.

Michael Jackson mjackson

Block or report user

Report or block mjackson

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
mjackson / travis.yml
Last active May 3, 2019
Travis CI + google-cloud-sdk + updated kubectl + Docker
View travis.yml
# The Google Cloud SDK on Travis is pretty old (2014). So if
# you want to use an up-to-date version, you have to install
# your own. This config is the bare minimum you'll need to
# get an updated version of the SDK + kubectl.
# We cache the SDK so we don't have to download it again on subsequent builds.
- $HOME/google-cloud-sdk
# Include the docker service so you can roll your own images.
View HOC-w-Render-Prop.js
import React from "react";
import ReactDOM from "react-dom";
import PropTypes from "prop-types"; = `
#1e5799 0%,
#2989d8 50%,
#207cca 51%,
#7db9e8 100%
mjackson / react-15-6-2.html
Last active May 10, 2018
React TestUtils Simulate regression between 15.6.2 and 16.3.2
View react-15-6-2.html
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<script src=""></script>
<div id="root"></div>
View router.js
import React from "react";
import pathToRegexp from "path-to-regexp";
function Home() {
return <h1>Home</h1>;
function About() {
return <h1>About</h1>;

Keybase proof

I hereby claim:

  • I am mjackson on github.
  • I am mjackson ( on keybase.
  • I have a public key ASDn-_bfhdzaHqvj4gcakU4yKWlK5RyzlcXQRJMQqYp2fwo

To claim this, I am signing this object:

mjackson / MyComponent.js
Last active Mar 7, 2018
Can we just plop some CSS right smack in the middle of our JavaScript code?!
View MyComponent.js
import React from "react";
body {
font-family: Helvetica, sans-serif;
.header-text {
font-weight: bold;
font-size: 2em;
mjackson /
Created Feb 6, 2018
Run multiple scripts for the same git hook
# This script should be saved in a git repo as a hook file, e.g. .git/hooks/pre-receive.
# It looks for scripts in the .git/hooks/pre-receive.d directory and executes them in order,
# passing along stdin. If any script exits with a non-zero status, this script exits.
script_dir=$(dirname $0)
hook_name=$(basename $0)
View package-info.json
"_id": "@dollarshaveclub-engineering/ui",
"_rev": "2-5773c0c926d450044de3c87bc8233fad",
"name": "@dollarshaveclub-engineering/ui",
"description": "DSC Web UI",
"dist-tags": {
"latest": "2.6.4"
"versions": {
"2.6.3": {
mjackson /
Last active Apr 11, 2018
More information about <Broadcast>/<Subscriber> deprecations in react-broadcast

<Broadcast> and <Subscriber> are being deprecated

<Broadcast> and <Subscriber> are being deprecated in react-broadcast in favor of a new API inspired by the new React context RFC. The goals of this change for react-broadcast users are:

  • Make it easier to upgrade to the new React context API when it eventually lands
  • Remove ambiguity around channels

How to upgrade to the new API

Instead of using pre-built <Broadcast> and <Subscriber> components, you create them for yourself. So instead of:

View Context-solution.js
/*eslint-disable no-alert */
// Exercise:
// Using context, implement the <Form>, <SubmitButton>, and <TextInput>
// components such that:
// - Clicking the <SubmitButton> calls <Form onSubmit>
// - Hitting "Enter" while in a <TextInput> submits the form
// - Don't use a <form> element, we're intentionally recreating the
You can’t perform that action at this time.