Skip to content

Instantly share code, notes, and snippets.

Thomas Greco tgrecojs

Block or report user

Report or block tgrecojs

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 Banner.tipe
query API {
Banner(id: "5aa474a451534a00133224b3") {
bannerImage {
url
}
headline
backgroundColor
}
}
View Banner.tipe
query API {
Banner(id: "5aa474a451534a00133224b3") {
bannerImage {
url
}
headline
backgroundColor
}
}
View dynamic-import-tipe.js
const DynamicFoo =
dynamic(import('../Posts.tipe').then(response => {
// post2 is alias
const { post2 } = response;
// Foo.__webpackChunkName = m.__webpackChunkName;
return response
}));
View algorithmGist.js
const test = require('tape');
const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
const trace = label => val => {
console.log(`${label}: ${val}`);
return val;
};
View Fork Repo Instructions.sh
#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
# Set forked repository's master branch to point to owners upstream/master
@tgrecojs
tgrecojs / next-link.jsx
Created Aug 23, 2017
example of prefetching next.js route via <Link />
View next-link.jsx
@tgrecojs
tgrecojs / index.js
Created Aug 20, 2017
next.js shell component
View index.js
import React from 'react';
export default ({title = 'How tight is this next.js thing?'}) => <h2>{title}</h2>;
View pure-component.test.js
test('<Post />', assert => {
const msg = 'should render a post';
const props = {
title : 'I am the title',
content: 'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam'
};
const actual = <Post {{...props}} />
const expected =
assert.end()
})
View pure-component.js
const Post = ({ title, content }) =>
<div>
<h2>{title}</h2>
<p>{content}</p>
</div>;
View questions.json
[
{
"_id": "5954748fa5f5ab0004f90f78",
"updatedAt": "2017-06-29T03:31:27.252Z",
"createdAt": "2017-06-29T03:31:27.252Z",
"questionString": "May I have a raise?",
"answer": "false",
"askee": "Mr. Bossman",
"answerWorth": 1,
"_createdBy": "thomasjosephgreco@gmail.com",
You can’t perform that action at this time.