Strategies to shorten build times for Gatsby websites.
srcSetBreakpoints
sets the quantity and dimensions of the images provided to
the srcset
property. By default, Gatsby Image (via gatsby-plugin-sharp
)
import { useEffect } from 'react' | |
import mitt from 'mitt' | |
// Creates an new event emitter and returns a hook that can listen to and emit | |
// events. | |
const create = () => { | |
const emitter = mitt() | |
const useEventEmitter = handlers => { | |
useEffect(() => { |
##################### | |
# Plugins | |
##################### | |
# Base | |
set -g @plugin 'tmux-plugins/tpm' | |
set -g @plugin 'tmux-plugins/tmux-sensible' | |
# UI | |
set -g @plugin 'seebi/tmux-colors-solarized' |
Strategies to shorten build times for Gatsby websites.
srcSetBreakpoints
sets the quantity and dimensions of the images provided to
the srcset
property. By default, Gatsby Image (via gatsby-plugin-sharp
)
import React from 'react' | |
import hoistNonReactStatics from 'hoist-non-react-statics' | |
// Returns the components name. If a name cannot be determined, "Component" is | |
// used. | |
const getComponentName = Component => | |
Component.displayName || Component.name || 'Component' | |
// Higher order component that automatically applies default props to the | |
// wrapped component. |
import { useState, useCallback, useEffect, useRef } from 'react' | |
const isBrowser = typeof window !== 'undefined' | |
export const useScrollDirection = ({ threshold = 0 }) => { | |
const UP = -1 | |
const STATIC = 0 | |
const DOWN = 1 | |
const prev = useRef(isBrowser ? window.scrollY : 0) |
import { | |
__, | |
compose, | |
difference, | |
has | |
isFunction, | |
isPlainObject, | |
keys, | |
negate, | |
} from 'lodash/fp' |
import * as R from 'ramda' | |
import * as RA from 'ramda-adjunct' | |
export const valuesDeep = | |
R.cond([ | |
[ | |
RA.isPlainObj, | |
R.pipe( | |
R.values, | |
R.map(x => valuesDeep(x)), |
Install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Create a Brewfile
touch ~/Brewfile
import React, { Component } from 'react' | |
import PropTypes from 'prop-types' | |
import { withStatechart } from 'react-automata' | |
const statechart = { | |
initial: 'idle', | |
states: { | |
idle: { | |
on: { | |
LOAD: 'loading', |
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |