In addition to the Storybook for React setup, you'll also need to install these packages:
npm i -D @babel/core babel-loader css-loader style-loader
import React, {useEffect} from "react"; | |
import {StyleProp, StyleSheet, TouchableOpacity, TouchableOpacityProps, ViewProps, ViewStyle} from "react-native"; | |
import Animated, { | |
interpolate, | |
useAnimatedStyle, | |
useSharedValue, | |
withTiming, | |
Easing, | |
Extrapolate, | |
interpolateColor, AnimateProps, |
const admin = require('firebase-admin'); | |
// expects the environment variable GOOGLE_APPLICATION_CREDENTIALS | |
const serviceAccount = require(process.env.GOOGLE_APPLICATION_CREDENTIALS); | |
const credential = admin.credential.cert(serviceAccount); | |
const PROJECT_ID = '<FIREBASE_PROJECT_ID>'; | |
const app = admin.initializeApp({ | |
credential: credential |
In addition to the Storybook for React setup, you'll also need to install these packages:
npm i -D @babel/core babel-loader css-loader style-loader
import { useState, useEffect } from 'react'; | |
// Usage | |
function App() { | |
// Call our hook for each key that we'd like to monitor | |
const happyPress = useKeyPress('h'); | |
const sadPress = useKeyPress('s'); | |
const robotPress = useKeyPress('r'); | |
const foxPress = useKeyPress('f'); |
year | week | feat | fix | docs | style | refactor | test | chore | Dev 1 | Dev 2 | Dev 3 | Dev 4 | Dev 5 | Dev 6 | Dev 7 | Dev 8 | Dev 9 | Dev 10 | Dev 11 | Dev 12 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2016 | 43 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | |
2016 | 44 | 0 | 0 | 0 | 0 | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 0 | 0 | |
2016 | 45 | 0 | 0 | 0 | 0 | 1 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | |
2016 | 51 | 2 | 0 | 0 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 0 | 0 | |
2016 | 52 | 5 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0 | 0 | 0 | |
2016 | 53 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | |
2017 | 1 | 5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 0 | 0 | 0 | |
2017 | 2 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 0 | 0 | |
2017 | 3 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 0 | 0 |
import React from 'react'; | |
const ConditionalWrap = ({condition, wrap, children}) => condition ? wrap(children) : children; | |
const Header = ({shouldLinkToHome}) => ( | |
<div> | |
<ConditionalWrap | |
condition={shouldLinkToHome} | |
wrap={children => <a href="/">{children}</a>} | |
> |
Updating Neil Freeman’s Block to d3.v4 that was riffing on the State Capitals Voronoi from Jason Davies, and using his spherical voronoi script.
# BREW with xcode | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
sudo xcodebuild | |
brew update | |
brew install caskroom/cask/brew-cask | |
# BROWSERS | |
brew cask install firefox google-chrome | |
# JAVA |
function largestBinaryGap(num) { | |
var bin = Math.abs(num).toString(2), | |
finalMax = 0, | |
currentMax; | |
for (var i = 0; i < bin.length; i++) { | |
currentMax = 0; | |
while (bin[i] === "0") { | |
++currentMax && ++i; | |
} |
height: 140 |