Skip to content

Instantly share code, notes, and snippets.

declare module 're-reselect' {
declare type Selector<S, P, R> = {
(S, P, ...rest: any[]): R;
};
declare type Resolver<S, P, K: number | string> = {
(state: S, P, ...rest: any[]): K;
};
declare type CachedSelectorCreator = {
// @flow
/* eslint-env browser */
/* eslint-disable complexity */
// =============================================================================
// Import modules
// =============================================================================
import React, {PureComponent} from 'react';
import {findDOMNode} from 'react-dom';
import classnames from 'classnames';
import sortBy from 'lodash/fp/sortBy';
import tinycolor from 'tinycolor2';
sortBy((color) => {
const {s: saturation, l: lightness} = tinycolor(color).toHsl();
const darkness = (1 - lightness);
const intensity = darkness * darkness * saturation * saturation;
return lightness + intensity * 20;
}, colors);
import compact from 'lodash/fp/compact';
export const anchorColor = (color, hover = color, visited = color) => ({
'&': {color},
'&:hover, &:visited:hover': {color: hover},
'&:visited': {color: visited},
});
export const mediaQuery = (rules) => {
let _rules = compact(rules);
.buttonBlue {
background-color: rgb(0, 120, 255);
color: rgb(255, 255, 255);
}
.buttonDarkGreen {
background-color: rgb(0, 90, 0);
color: rgb(255, 255, 255);
}
export const colors = {
blue: '#0080ff',
green: '#005a00',
};
export const sizes = {
small: 12,
medium: 16,
large: 24,
};
import chalk from 'chalk';
import path from 'path';
import errorCallSites from 'error-callsites';
import {SourceMapConsumer} from 'source-map';
import {retrieveSourceMap} from 'source-map-support/source-map-support';
const sourceMapCache = {};
const fileContentsCache = {};
export function supportRelativeURL(file, url) {
@10xjs
10xjs / load-nvm.sh
Last active October 23, 2020 05:27
export NVM_DIR="$HOME/.nvm"
. "/usr/local/opt/nvm/nvm.sh"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Enable ZSH hook method.
autoload -U add-zsh-hook
# `load-nvm` recursively looks for `.nvmrc` or `package.json` files in the
# current and parent directories. When a file defining a node version that is
#
# EditorConfig: http://EditorConfig.org
#
# This files specifies some basic editor conventions for the files in this
# project. Many editors support this standard, you simply need to find a plugin
# for your favorite!
#
# For a full list of possible values consult the reference.
# https://github.com/editorconfig/editorconfig/wiki/EditorConfig-Properties
#
// (with COMMIT_EDITMSG open) Sublime Text > Preferences > Settings - More > Syntax Specific - User
{
"rulers":
[
50
],
"spell_check": true
}