Skip to content

Instantly share code, notes, and snippets.

Being foxy

Andy Ingram AndrewIngram

Block or report user

Report or block AndrewIngram

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
View SketchSystems.spec
My Awesome Sketch
First State
some event -> Second State
Second State
View LoginForm.js
import React from "react";
import useLogin from "@zego/hooks/useLogin";
import BaseLoginForm from "./BaseLoginForm";
import { withTrackableFeature } from "@zego/tracking";
const LoginFormImpl = props => {
const login = useLogin();
AndrewIngram / routes.js
Created Jan 10, 2019
Basic router on top of Next.js
View routes.js
import { include, createRouter } from "./lib/router";
const commonRoutes = [
path: "/terms-of-business/",
name: "terms-of-business",
page: "TermsOfBusinessPage",
AndrewIngram / routes.js
Last active Jan 9, 2019
Router API Idea
View routes.js
import { routes, include } from "@framework/router";
import { relayView, xmlView } from "@framework/engine";
const gbRoutes = routes(
route({ path: "/", view: "./views/gb/HomepageGb" }),
route({ path: "/scooter/", view: "./views/gb/ScooterGb" }),
route({ path: "/car/", view: "./views/gb/CarGb" }),
route({ path: "/private-hire/", view: "./views/gb/PrivateHireGb" }),
route({ path: "/blog/:slug/", view: "./views/BlogPost" })
View meurgh.js
const path = require('path');
const { createFileNode } = require(`gatsby-source-filesystem/create-file-node`);
async function createLocaleFileNode(filePath, createNode, createNodeId) {
const fileNode = await createFileNode(
path.resolve(__dirname, filePath),
AndrewIngram / Example.js
Last active Oct 17, 2018
Interpose FFS
View Example.js
<Interpose separator={<Hairline />}>
{ => <ProductListItem product={product} key={} />)}
AndrewIngram / Price.js
Created May 10, 2018
Simple Relay component
View Price.js
// @flow
import { PureComponent } from 'react';
import { graphql, createFragmentContainer } from 'react-relay';
import FormatCurrency from '@zego/components/FormatCurrency';
import { type Price_price } from './__generated__/Price_price.graphql';
type Props = {
price: Price_price,
View blah.js
const authRequired = resolver => (obj, args, context, info) => {
if (!context.user) {
return new UserError('Authentication Required');
return resolver(obj, args, context, info);
const myResolver = authRequired((obj, args, context, info) => {
// Normal logic
View schema.js
import { makeExecutableSchema } from "graphql-tools";
import RawSchema from "./RawSchema";
import nodeResolver from "./nodeResolver";
import * as graphQLModules from "glob:./**/*.graphql.js";
const schema = new RawSchema();
View schema_snippet.js
export default schema => {
type Venue implements Node {
id: ID!
name: String!
address1: String
address2: String
description: String
postalCode: String
location: Point
You can’t perform that action at this time.