This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
h1 { | |
fonst-size: clamp(1em, 1em + 2vw, 3em); | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Fluid font-size headline</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* { | |
/*prevents tabing highlight issue in mobile */ | |
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); | |
-moz-tap-highlight-color: rgba(0, 0, 0, 0); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export LANG="en_US.UTF-8" | |
export LC_ALL="en_US.UTF-8" | |
export FZF_DEFAULT_OPTS='--height 40% --reverse --border --inline-info --color=dark,bg+:235,hl+:10,pointer:5' | |
export ENHANCD_FILTER="fzf:peco:percol" | |
export ENHANCD_COMMAND='c' | |
# If you come from bash you might have to change your $PATH. | |
export PATH=$HOME/bin:/usr/local/bin:$PATH | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const graphqlHTTP = require('express-graphql'); | |
const { buildSchema } = require('graphql'); | |
const jwt = require('jsonwebtoken'); | |
const unless = require('express-unless'); | |
const schema = buildSchema(` | |
type Query { | |
hostname: String | |
} | |
`); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npx create-react-app my-app --template redux-typescript |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createInterceptorMiddleware = (interceptors) => (store) => (next) => (action) => { | |
Promise.all( | |
interceptors | |
.filter(interceptor => interceptor.type === action.type) | |
.map(interceptor => { | |
const result = interceptor.handler(action, store.dispatch, store.getState); | |
return result instanceof Promise ? result : Promise.resolve(result); | |
}) | |
) | |
.then((afterDispatchHandlers) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the family class is going to behave as tho | |
// its a JavaScript array internally so we can leverage | |
// the functionality of JavaScript arrays | |
class Family { | |
constructor() { | |
// Arrays have a length prop so we should too! | |
this.length = 0; | |
} | |
addFamilyMember = (name) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useReducer, useEffect, useRef } from 'react'; | |
import firebase from 'firebase/app'; | |
import equal from 'deep-equal'; | |
function filterKeys(raw, allowed) { | |
if (!raw) { | |
return raw; | |
} | |
let s = new Set(allowed); | |
return Object.keys(raw) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// random.ts | |
function randomId(): string { | |
const uint32 = window.crypto.getRandomValues(new Uint32Array(1))[0]; | |
return uint32.toString(16); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jest.mock('moment', () => { | |
const moment = jest.requireActual('moment'); | |
return {default: moment }; | |
}); |