Reach UI is an accessible foundation for React applications and design systems.
The three equally important goals are to be:
- Accessible
- Composable
- Stylable
export default function () { | |
return process.env.NODE_ENV === 'development' ? ( | |
<script src="http://localhost:35729/livereload.js?snipver=1"></script> | |
) : null | |
} |
import React, { useState } from 'react' | |
import ReactMapGL, { Marker } from 'react-map-gl' | |
import { WebMercatorViewport } from '@deck.gl/core' | |
const getBoundsForPoints = (points, { width = 200, height = 500, padding = 0 } = {}) => { | |
// Calculate corner values of bounds | |
const pointsLong = points.map(point => point.coordinates._long) | |
const pointsLat = points.map(point => point.coordinates._lat) | |
const cornersLongLat = [ | |
[Math.min(...pointsLong), Math.min(...pointsLat)], |
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.
~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, |
/** | |
* 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) { |
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
// 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 ( |
Happy! | |
====== | |
Personified syntax | |
nil = # | |
hash = @ key*value @ | |
string = :delimiters) | |
boolean = true S, false$ , %% and ^^or | |
integer = V1 V2 all have Vs in front |
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: |