works
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 plugin = require('tailwindcss/plugin'); | |
/** @type {import('tailwindcss').Config} */ | |
module.exports = { | |
... | |
theme: { | |
extend: {}, | |
... | |
}, | |
plugins: [ | |
// default utils |
test again
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 type { ReactNode } from 'react' | |
import { forwardRef } from 'react' | |
import type { LinkProps as ChakraLinkProps } from '@chakra-ui/react' | |
import { Link as ChakraLink } from '@chakra-ui/react' | |
import type { LinkProps as NextLinkProps } from 'next/dist/client/link' | |
import NextLink from 'next/link' | |
import { useRouter } from 'next/router' | |
export type WithChildren<Props = {}> = Props & { | |
children: ReactNode | |
} |
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
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; | |
export function withAppContext< | |
P extends { appContext?: AppContextInterface }, | |
R = Omit<P, 'appContext'> | |
>( | |
Component: React.ComponentClass<P> | React.StatelessComponent<P> | |
): React.SFC<R> { | |
return function BoundComponent(props: R) { | |
return ( |
in web dev sometimes you are constrained to develop from behind a https:// local server. i spent two days making this work and i want to write it down here, so that next time apple upgrades OS X and i decide to do a clean install (forgetting to backup certain things) i dont waste this amount of time anymore (i hope).
maybe it helps someone else too. that would make me very happy too.
major pita to remember commands. i don't think there is anything better that makes your mom feel like you are a hacker, than showing her how to type:
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
shopt -s globstar # enable ** globstar/recursivity | |
for i in **/*.js; do | |
[[ -d "$i" ]] && continue; # skip directories | |
mv "$i" "${i/%.js}.tsx"; | |
done |
const array = [1, 2, 4]
const collection = [{ type: 1, eyes: 'blue'},{ type: 2, eyes: 'brown'}, { type: 3, eyes: 'green'}, { type: 4, eyes: 'blue'}]
const joinByType = R.innerJoin(
(o, type) => o.type === type
)
const result = joinByType(collection, array)
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
countWords = text => { | |
return text.split(/\s+/).length | |
} | |
const words = this.countWords(article.body) | |
const readTime = Math.round(words / 250) | |
const minutes = readTime === 1 ? 'minute' : 'minutes' | |
//Render this | |
Aproximately {readTime} {minutes} |
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 path = require('path') | |
module.exports = { | |
entry: { | |
subdomains: './src/index.js', | |
}, | |
optimization: { | |
occurrenceOrder: true, | |
splitChunks: { | |
cacheGroups: { |
NewerOlder