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
function myForEach<T>(arr: T[], forEachFunc: (v: T) => void) { | |
arr.reduce((acc, val) => { | |
forEachFunc(val) | |
return undefined; | |
}, undefined) | |
} | |
function myFilter<T> (arr: T[], filterFunc: (v: T) => boolean): T[] { | |
return arr.reduce((acc: T[], val) => { | |
if (filterFunc(val)) { |
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
// Using react-error-boundary library to handle custom error component in case of dom failure | |
// Error boundary will render the fallback component to its decendents in case of failure | |
// So we can add multiple error boundaries according to project | |
import { useState } from 'react' | |
import ReactErrorBoundary from 'react-error-boundary' | |
const ErrorBoundary = ReactErrorBoundary.ErrorBoundary | |
function ErrorFallback ({ error }) { |
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
@media not all and (min-resolution:.001dpcm) | |
{ @supports (-webkit-appearance:none) { | |
.safari_only { | |
color:#0000FF; | |
background-color:#CCCCCC; | |
} | |
}} |
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
.full-width { | |
left: 50%; | |
margin-left: -50vw; | |
margin-right: -50vw; | |
max-width: 100vw; | |
position: relative; | |
right: 50%; | |
width: 100vw; | |
} |
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 D = document | |
const $ = D.querySelector.bind(D) | |
const $$ = (selector, startNode = D) => [...startNode.querySelectorAll(selector)] |
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
{ | |
"extends": [ | |
"airbnb", | |
"prettier", | |
"prettier/react" | |
], | |
"parser": "babel-eslint", | |
"parserOptions": { | |
"ecmaVersion": 8, | |
"ecmaFeatures": { |
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
PS1='\[\033]0;Terminal: ${PWD//[^[:ascii:]]/?}\007\]' # set window title | |
PS1="$PS1"'\n' # new line | |
PS1="$PS1"'\[\033[33m\]' # change to green | |
PS1="$PS1"'❯' # -> | |
PS1="$PS1"'\W ❯' | |
PS1="$PS1"'\[\033[0m\]' # change color | |
MSYS2_PS1="$PS1" # for detection by MSYS2 SDK's bash.basrc | |
# 🎵 💎⭐🔥➤ |
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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// POKEMON THEME CONFIG | |
// pokemon: 'gengar', | |
// STAR WARS THEME CONFIG | |
// StarWarsTheme: { |