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 dummy-data.json
{
"cols": [
"people",
"dates",
"zips",
"companies"
],
"data": [
[
"Nigel",
View dummy-data.json
{
"cols": [
"people",
"dates",
"zips",
"companies"
],
"data": [
[
"Nigel",
View brace expansions.sh
# Exhibit A: long form way of installing packages
npm install eslint-config-airbnb eslint-config-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-html eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-prettier
# Exhibit B: using brace expansion
npm install eslint-{config-{airbnb,pretter},plugin-{react-hooks,react,html,import,jsx-a11y,prettier}}
View script.md

Intro

1. Show Array

  • Let's pretend for a second that this pplFromAPI array isn't hardcoded, and instead it's being returned to us depending on service calls elsewhere in our application.
  • It's our job to transform this data into a 1dimensional array for the UI to iterate over and display accordingly.

2. - const flattenData = (arr = peopleArray) => [].concat(...ar)

  • One way of implementing this is using .concat in conjunction with the ...spread operator introduced with the release of ES6.

3 "highligh dots"

Shields us having to iterate thru each nested array, building up the final value on each pass.

View script.md

Intro

1. Show Array

  • Let's pretend for a second that this pplFromAPI array isn't hardcoded, and instead it's being returned to us depending on service calls elsewhere in our application.
  • It's our job to transform this data into a 1dimensional array for the UI to iterate over and display accordingly.

2. - const flattenData = (arr = peopleArray) => [].concat(...ar)

  • One way of implementing this is using .concat in conjunction with the ...spread operator introduced with the release of ES6.

3 "highligh dots"

Shields us having to iterate thru each nested array, building up the final value on each pass.

View prof-frisby-notes.md

Mostly Adequete FP Notes

Chapter 9

var Container = function(x) {
  this.__value = x;
}

Container.of = function(x) { return new Container(x); };
View TG.md
View index.js
import Banner from '../source/Banner/component';
import Post from '../source/Post/component';
import Link from 'next/link';
import { post1, post2, post3 } from '../Posts.tipe';
import Layout from '../source/Layout/component';
const App = () =>
<Layout>
<Banner />
@tgrecojs
tgrecojs / component.js
Last active Mar 12, 2018
source/Banner/component.js
View component.js
const Image = ({headline, bgColor, image }) =>
<div className="banner" style={{background: bgColor}}>
<img className="bannerImage" src={`${image.url}`} alt="tg banner"/>
<h2>{headline}</h2>
</div>
export default Image;
View Posts.tipe
query API {
post1: BlogPosts(id: "5aa48ebb5150d400139136c9") {
postBody
description
_meta {
name
}
}
post2: BlogPosts(id : "5aa4a49c106e4d0013bf87d8") {
postBody
You can’t perform that action at this time.