Skip to content

Instantly share code, notes, and snippets.

⚾️
Baseball Season

Tyler Sustare TylerSustare

⚾️
Baseball Season
Block or report user

Report or block TylerSustare

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
@TylerSustare
TylerSustare / batchedSequentialPromiseAll.js
Created Sep 26, 2019
Sequential Promise.all() in batches
View batchedSequentialPromiseAll.js
const waait = i => new Promise(res => setTimeout(() => { return res(i); }, 2000));
const batchedPromiseAll = async (array) => {
let requests = array.slice(0);
let results = [];
let processBatch = async (chunks, results) => {
let curr;
try {
@TylerSustare
TylerSustare / change_the_rest.js
Last active Sep 17, 2019
Neat use of rest operator in React
View change_the_rest.js
class SomeClass extends Component {
onChange({ ...rest }) {
this.setState(rest);
};
options = {
// ...
onChangePage: currentPage => this.onChange({ currentPage }),
onChangeRowsPerPage: numberOfRows => this.onChange({ numberOfRows })
};
View .prettierrc
{
"tabWidth": 2,
"singleQuote": true,
"useTabs": false,
"printWidth": 100
}
View CloudFormationExample.yaml
# Super simple example
Resources:
Ec2Instance:
Type: 'AWS::EC2::Instance'
Properties:
InstanceType: t2.micro
ImageId: ami-46ca739 # Amazon Linux AMI
# Update with a Tag
Tags:
- Key: Name
@TylerSustare
TylerSustare / app.js
Last active Jan 9, 2019
firebase realtime database crud
View app.js
import React, { Component } from 'react'
import firebase from 'firebase';
import uuid from 'uuid/v4';
const words = [
'spoon',
'fish',
'wish',
'squish',
'squash',
You can’t perform that action at this time.