Skip to content

Instantly share code, notes, and snippets.

View indiesquidge's full-sized avatar

Austin Wood indiesquidge

View GitHub Profile
@kiliman
kiliman / LiveReload.tsx
Last active January 19, 2022 15:44
Remix Run and Tailwind CSS config with jit support
export default function () {
return process.env.NODE_ENV === 'development' ? (
<script src="http://localhost:35729/livereload.js?snipver=1"></script>
) : null
}
@tomsoderlund
tomsoderlund / Map.js
Created June 22, 2020 09:50
Using fitBounds in ReactMapGL to center points on map
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 = [

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 April 6, 2018 20:27
My Buttermilk Pancake Recipe 🥞🥞🥞

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

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 October 4, 2018 05:42
Exponential backoff retry logic for a function that returns a Promise
/**
* 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 April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

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 April 11, 2024 06:46
connect.js explained
// 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 February 4, 2016 14:50
Student syntaxes for JSON data structures!
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 April 24, 2024 18:56
Arrayzing - The JavaScript array cheatsheet
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: