Skip to content

Instantly share code, notes, and snippets.

Mike Allanson m-allanson

Block or report user

Report or block m-allanson

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
m-allanson / gatsby-node.js
Last active May 31, 2019
Modify a rule from your Gatsby site's webpack config
View gatsby-node.js
exports.onCreateWebpackConfig = ({ actions, getConfig }) => {
// inline files that are smaller than this (in bytes), Gatsby's default vaule is 10000
const LIMIT = 2000;
// find patterns from gatsby/src/utils/webpack-utils.js
// for fonts instead of images, use: /\.(eot|otf|ttf|woff(2)?)(\?.*)?$/
const PATTERN = /\.(ico|svg|jpg|jpeg|png|gif|webp)(\?.*)?$/;
const config = getConfig();
View SketchSystems.spec
Pull Requests
Awaiting Maintainer Response
maintainer approves -> Approved
maintainer requests changes -> Awaiting Contributor Response
maintainer rejects -> Closed
maintainer finishes PR -> Approved
Awaiting Contributor Response
contributor updates -> Awaiting Maintainer Response
no timely contributor update -> Awaiting Maintainer Response
View gatsby-ssr.js
* Creates a preload link pointing to myFonts' licence counting url. This
* allows hits to the site to register as font requests with myFonts, but
* ensures that we are not blocking CSS rendering by waiting for this request
* to complete.
* This avoids having to include the following in a CSS file:
* @import url("//<id>");
* Refs:
View transitionSnippet.js
static getDerivedStateFromProps(props, state) {
const { pathname } = props.location;
if (!state.lastPathname || pathname !== state.lastPathname) {
return {
lastPathname: pathname,
transitionName: getTransitionName({
from: state.lastPathname,
to: pathname,
m-allanson /
Last active Aug 16, 2018
Gatsby Gazette 2018-08-16

Hey folks,

Here's the all new "Gatsby Gazette". It's new because I changed the name.

Let's get down to business:

  • Event news - a lot of the Gatsby team will be in Portland (the city in Oregon USA, not the tiny island off the South coast of England), so there'll be a Gatsby team meetup, check out @jlengstorf's post just below this one.

That v2 release candidate is getting closer. As a change from the normal format of these posts let's take a short tour through some recent pull requests.

m-allanson /
Last active Aug 8, 2018
Gatsby report 2018-08-08

Hey folks,

Here's what's happening in Gatsby, starting with a hat-trick of event updates:

m-allanson /
Created Aug 1, 2018
Gatsby report 2018-08-01

Hey folks,

Here's what's been going on with Gatbsy this week:


Keybase proof

I hereby claim:

  • I am m-allanson on github.
  • I am mallanson ( on keybase.
  • I have a public key ASCW_f57zz8JNYQcE16pb5wwS2HM_Klo3b996YK529xEtwo

To claim this, I am signing this object:

m-allanson / fileMock.js
Created Nov 16, 2017
Using Jest with Gatsby
View fileMock.js
// in __mocks__/
// Jest file stub
module.exports = "test-file-stub";
cd dev/projects/
∴ projects
git clone
Cloning into ''...
remote: Counting objects: 2273, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 2273 (delta 0), reused 1 (delta 0), pack-reused 2268
Receiving objects: 100% (2273/2273), 27.23 MiB | 5.49 MiB/s, done.
Resolving deltas: 100% (1165/1165), done.
You can’t perform that action at this time.