Skip to content

Instantly share code, notes, and snippets.

View jlengstorf's full-sized avatar
💭
partyin

Jason Lengstorf jlengstorf

💭
partyin
View GitHub Profile
schema.buildInterfaceType({
name: "MyInterface",
fields: {
name: {
type: "String!",
resolve: () => 'data'
}
},
}),
@jlengstorf
jlengstorf / airtable-accessibility.diff
Created July 9, 2019 17:43
Markup changes to make Airtable form fields more accessible.
<div class="sharedFormField required">
- <div class="title">Organizer's First Name</div>
+ <label for="input1" class="title">Organizer's First Name</div>
<div class="cellContainer">
<div class="cell formCell" data-columntype="text">
<div class="flex-auto flex baymax">
<input
+ id="input1"
type="text"
value=""
// Quick-and-dirty helper to convert strings into URL-friendly slugs.
const slugify = str =>
str
.toLowerCase()
.replace(/[^a-z0-9]+/g, '-')
.replace(/(^-|-$)+/g, '');
const createNodeHelpers = require('gatsby-node-helpers').default;
const people = require('./data/people.json');
const cocktails = require('./data/cocktails.json');
const { createNodeFactory } = createNodeHelpers({
typePrefix: 'Relationships'
});
const PersonNode = createNodeFactory('Person');
const CocktailNode = createNodeFactory('Cocktail');
@jlengstorf
jlengstorf / gatsby-node.js
Created October 9, 2018 02:28
Creating node relationships in Gatsby.
const createNodeHelpers = require('gatsby-node-helpers').default;
const { createNodeFactory } = createNodeHelpers({
typePrefix: 'MyData'
});
const FooNode = createNodeFactory('Foo');
const BarNode = createNodeFactory('Bar');
const foo = { id: 'foo', value: 'foo' };
@jlengstorf
jlengstorf / store-demo-info.md
Last active June 27, 2018 22:22
Details for the Gatsby Swag Store demo.

@marisamorby and I are going to walk through the swag store we’ve been building for Gatsby to show off the tech stack (Peril, Gatsby, Auth0, Shopify, MailChimp, GitHub, custom REST API) and show off the new swag that's coming for Gatsby — and how all Gatsby contributors can get it for free!

Details

Video of the demo: https://youtu.be/MMF0zUqBjPQ

@jlengstorf
jlengstorf / example.html
Created June 23, 2018 00:34
Load third-party CSS in a non-blocking way.
<html>
<head>
<!-- head content -->
</head>
<body>
<!-- body content -->
<script type="text/javascript">
@jlengstorf
jlengstorf / gatsby-config.js
Created June 14, 2018 21:33
"Before" code for an egghead video.
module.exports = {
siteMetadata: {
title: 'My Fantastic Website!'
}
};
@jlengstorf
jlengstorf / gatsby-config.js
Created June 14, 2018 21:30
"After" code for an egghead starter video.
module.exports = {
siteMetadata: {
title: 'My Fantastic Website!'
}
};
@jlengstorf
jlengstorf / *README.md
Last active March 21, 2018 13:36
Create custom git.io short links by adding this helper function to your `.bash_profile`

Create Custom git.io Short Links

Add this helper function to your ~/.bash_profile (or ~/.bashrc, or whatever you use) to create custom short links for your GitHub projects without having to remember the whole cURL command!

Installation

If you use a file other than ~/.bash_profile to configure your terminal, substitute that value in the installation instructions below.

  1. Open your ~/.bash_profile
  2. Copy-paste the gitlink function into it