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
| Find Regex: | |
| import(?:["'\s]*([\w*{}\n\r\t, ]+)\s)from\s*?["'](\w.*)["'\s].* | |
| Replace Regex: | |
| import $1 from '$2.ts' | |
| or |
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 { chain, fromPairs, map, toPairs, type } from 'ramda' | |
| export const flattenObj = (obj: Record<string | number, string>) => { | |
| const go = (obj_: Record<string | number, string>): any[] => | |
| chain(([k, v]: [k: string, v: Record<string | number, string>]) => { | |
| if (type(v) === 'Object' || type(v) === 'Array') { | |
| return map(([k_, v_]: [k_: string, v_: string]) => [`${k}.${k_}`, v_], go(v)) | |
| } | |
| return [[k, v]] | |
| }, toPairs(obj_)) |
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
| 'use strict'; | |
| Object.defineProperty(exports, '__esModule', { value: true }); | |
| exports.default = function babelPluginTransformCreateSelector({ types: t }) { | |
| // Add the variable name as the first argument to the createSelector function | |
| function addNameArgument(body, name) { | |
| body.arguments.unshift(t.stringLiteral(name)); | |
| array.push(name); | |
| } | |
| // Find and add the variable name as the first argument to the createSelector function in Arrow Function Expression |
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
| // btoa() only support characters from String.fromCodePoint(0) up to String.fromCodePoint(255). | |
| // For Base64 characters with a code point 256 or higher you need to encode/decode these before and after. | |
| // “convert string to Base64” usually means “encode string as UTF-8 and encode the bytes as Base64”, and that's exactly what btoa(unescape(encodeURIComponent(str))) does. | |
| // Without unescape you don't get a Base64 representation of a UTF-8 encoded string. | |
| // https://stackoverflow.com/questions/30631927/converting-to-base64-in-javascript-without-deprecated-escape-call | |
| // The MDN article originally suggested using unescape and escape to solve the Character Out Of Range exception problem, but they have since been deprecated. | |
| // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/unescape | |
| // solutions from https://stackoverflow.com/questions/30106476/using-javascripts-atob-to-decode-base64-doesnt-properly-decode-utf-8-strings | |
| // Encoding UTF8 ⇢ base64 |
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 { DependencyList, useEffect } from 'react' | |
| type Effect<T> = (isMounted: () => boolean) => T | PromiseLike<T> | |
| type Destroy<T> = DependencyList | ((result: T) => void) | |
| function hasDestroy<T>(destroy?: Destroy<T>): destroy is (result: T) => void { | |
| return typeof destroy === 'function' | |
| } | |
| export function useAsyncEffect<T = unknown>( |
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
| .main-nav { | |
| position: relative; | |
| width: auto; | |
| // width: 320px; | |
| min-height: 51px; | |
| // margin: 0 auto; | |
| background-color: #826550; | |
| } |
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
| body { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| a { | |
| text-decoration: none; | |
| } | |
| img { |
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
| a.arrow { | |
| display: inline-block; | |
| margin: 0 10px; | |
| font-size: 0; | |
| } | |
| .arrow::before { | |
| content: ""; | |
| display: inline-block; | |
| border: 20px solid #0074d9; |