This file contains 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 * as React from "react"; | |
type ThemeConfig = "system" | "light" | "dark"; | |
type ThemeName = "light" | "dark"; | |
// Custom themes are keyed by a unique id. | |
type KeyedThemes = { | |
[k: string]: { | |
config: ThemeConfig; | |
themeName: ThemeName; | |
}; |
This file contains 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 from 'react' | |
import firebaseConfig from '../path/to/firebase-config' | |
import firebase from 'firebase/app' | |
import 'firebase/auth' | |
import FullPageLoading from '../path/to/full-page-loading' | |
AuthProvider.actions = { | |
setUser: 'SET_USER', | |
toggleLoading: 'TOGGLE_LOADING', | |
} |
This file contains 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 from 'react' | |
type DropzoneContextValue = { | |
isDragging: boolean | |
} | |
const DropzoneContext = React.createContext<DropzoneContextValue | undefined>( | |
undefined | |
) |
This file contains 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 from "react"; | |
function isMobile() { | |
if (typeof document !== `undefined`) { | |
return "ontouchstart" in document.documentElement === true; | |
} | |
return false; | |
} | |
const mobile = isMobile(); |
This file contains 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 capturePosition = () => { | |
const cachedPosition = window.pageYOffset | |
return { | |
freeze: () => { | |
document.body.style = | |
`position: fixed; | |
top: ${cachedPosition * -1}px; | |
width: 100%;` | |
}, | |
unfreeze: () => { |
This file contains 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
// Turn off server | |
sudo service nginx stop | |
// Renew certbot | |
certbot-auto renew —debug | |
// If failed, run this, then rerun renew command | |
sudo /opt/eff.org/certbot/venv/local/bin/pip install cryptography interface | |
// If failed |
This file contains 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
// recursively remove all attributes from a node and all its children | |
const recursiveRemove = node => { | |
removeAttributes(node) | |
while (node.childNodes.length > 0) { | |
for (let child of node.childNodes) { | |
node = child | |
if (node.nodeName !== 'IMG') { | |
recursiveRemove(child) | |
} | |
} |
This file contains 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
set nocompatible | |
set encoding=utf-8 nobomb | |
filetype off | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" Vundle manages Vundle 😀 | |
Plugin 'VundleVim/Vundle.vim' |