Skip to content

Instantly share code, notes, and snippets.

Avatar

Austin Wood indiesquidge

  • San Francisco, CA
View GitHub Profile
@tomsoderlund
tomsoderlund / Map.js
Created Jun 22, 2020
Using fitBounds in ReactMapGL to center points on map
View Map.js
import React, { useState } from 'react'
import ReactMapGL, { Marker, WebMercatorViewport } from 'react-map-gl'
const applyToArray = (func, array) => func.apply(Math, array)
const getBoundsForPoints = (points) => {
// Calculate corner values of bounds
const pointsLong = points.map(point => point.coordinates._long)
const pointsLat = points.map(point => point.coordinates._lat)
const cornersLongLat = [
View Reach Philosophy.md

Reach UI Philosophy

Reach UI is an accessible foundation for React applications and design systems.

The three equally important goals are to be:

  • Accessible
  • Composable
  • Stylable
@alanbsmith
alanbsmith / buttermilk-pancake-recipe.md
Created Apr 6, 2018
My Buttermilk Pancake Recipe 🥞🥞🥞
View buttermilk-pancake-recipe.md

BUTTERMILK PANCAKES 🥞

OVERVIEW

This recipe is loosely adapted from this NYT recipe. They come out super fluffy. It also works great for waffles. I make my own buttermilk with whole milk and white vinegar, which I'll describe below.

YIELD

~8 pancakes

View http.js
const config = require('./config');
const fetch = require('node-fetch');
const querystring = require('querystring');
module.exports = {
get,
post,
put,
delete: httpDelete, // function name can't be 'delete'
fetchJsonWithAuth,
@scwood
scwood / attemptWithRetry.js
Last active Oct 4, 2018
Exponential backoff retry logic for a function that returns a Promise
View attemptWithRetry.js
/**
* Retries a function that returns a promise a given number of times and backs
* off each attempt exponentially.
*
* @param {Function} promiseGenerator The function to retry.
* @param {number} [attempts=5] Number of attempts to make.
* @param {number} [delay=1000] Initial delay between attempts in ms.
* @return {Promise}
*/
function attemptWithRetry(promiseGenerator, attempts = 5, delay = 100) {
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active Nov 26, 2020
What I Wish I'd Known About Equity Before Joining A Unicorn
View what-i-wish-id-known-about-equity-before-joining-a-unicorn.md

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@gaearon
gaearon / connect.js
Last active Nov 24, 2020
connect.js explained
View connect.js
// connect() is a function that injects Redux-related props into your component.
// You can inject data and callbacks that change that data by dispatching actions.
function connect(mapStateToProps, mapDispatchToProps) {
// It lets us inject component as the last step so people can use it as a decorator.
// Generally you don't need to worry about it.
return function (WrappedComponent) {
// It returns a component
return class extends React.Component {
render() {
return (
@JoshCheek
JoshCheek / happy
Created Feb 4, 2016
Student syntaxes for JSON data structures!
View happy
Happy!
======
Personified syntax
nil = #
hash = @ key*value @
string = :delimiters)
boolean = true S, false$ , %% and ^^or
integer = V1 V2 all have Vs in front
@ourmaninamsterdam
ourmaninamsterdam / LICENSE
Last active Nov 27, 2020
Arrayzing - The JavaScript array cheatsheet
View LICENSE
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@ericelliott
ericelliott / blue-tape-api.js
Created Jul 11, 2015
blue-tape Promise API
View blue-tape-api.js
test('Greet World', (assert) => new Promise((resolve) => {
assert.equal(hello('World'), 'Hello, World!');
setTimeout(() => {
// do some async stuff
resolve();
}, 10);
}));
You can’t perform that action at this time.