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
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
// https://github.com/gatsbyjs/gatsby/blob/03ddfdf9b6f5a132fe82c202c95829f6f42cd40b/packages/gatsby/src/utils/webpack-utils.js#L288-L435
// 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
Approved
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("//hello.myfonts.net/count/<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
m-allanson / gazette-2018-08-16.md
Last active Aug 16, 2018
Gatsby Gazette 2018-08-16
View gazette-2018-08-16.md

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
m-allanson / report-2018-08-08.md
Last active Aug 8, 2018
Gatsby report 2018-08-08
View report-2018-08-08.md

Hey folks,

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

@m-allanson
m-allanson / report.md
Created Aug 1, 2018
Gatsby report 2018-08-01
View report.md

Hey folks,

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

View keybase.md

Keybase proof

I hereby claim:

  • I am m-allanson on github.
  • I am mallanson (https://keybase.io/mallanson) on keybase.
  • I have a public key ASCW_f57zz8JNYQcE16pb5wwS2HM_Klo3b996YK529xEtwo

To claim this, I am signing this object:

@m-allanson
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";
View output.md
cd dev/projects/
∴ projects
git clone git@github.com:ahmedelgabri/gabri.me.git
Cloning into 'gabri.me'...
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.