Skip to content

Instantly share code, notes, and snippets.

@tgrecojs
tgrecojs / index.js
Created August 20, 2017 07:44
next.js shell component
import React from 'react';
export default ({title = 'How tight is this next.js thing?'}) => <h2>{title}</h2>;
@tgrecojs
tgrecojs / next-link.jsx
Created August 23, 2017 18:06
example of prefetching next.js route via <Link />
#https://egghead.io/lessons/javascript-how-to-fork-and-clone-a-github-repository
# Step 1 - Fork Repo want to work with & clone it to your machine.
git clone https://github.com/tgrecojs/example-repo
# cd into repo
cd example-repo
# Add upstream branch
git remote add upstream https://github.com/<repoOwner>/example-repo
# fetch upstream branches
git fetch upstream
# Point master branch of forked repo to the upstream repo's master branch
const test = require('tape');
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
const trace = label => val => {
console.log(`${label}: ${val}`);
return val;
};
const DynamicFoo =
dynamic(import('../Posts.tipe').then(response => {
// post2 is alias
const { post2 } = response;
// Foo.__webpackChunkName = m.__webpackChunkName;
return response
}));
@tgrecojs
tgrecojs / Banner.tipe
Created March 12, 2018 02:41
Banner.tipe
query API {
Banner(id: "5aa474a451534a00133224b3") {
bannerImage {
url
}
headline
backgroundColor
}
}
@tgrecojs
tgrecojs / Banner.tipe
Created March 12, 2018 02:41
Banner.tipe
query API {
Banner(id: "5aa474a451534a00133224b3") {
bannerImage {
url
}
headline
backgroundColor
}
}
@tgrecojs
tgrecojs / Banner.tipe
Created March 12, 2018 02:41
Banner.tipe
query API {
Banner(id: "5aa474a451534a00133224b3") {
bannerImage {
url
}
headline
backgroundColor
}
}
query API {
post1: BlogPosts(id: "5aa48ebb5150d400139136c9") {
calender
postBody
description
_meta {
id
name
}
}
query API {
post1: BlogPosts(id: "5aa48ebb5150d400139136c9") {
postBody
description
_meta {
name
}
}
post2: BlogPosts(id : "5aa4a49c106e4d0013bf87d8") {
postBody