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
| module.exports = { | |
| webpack(config, options) { | |
| const { dir, defaultLoaders } = options | |
| config.pageExtensions.push(".ts", ".tsx"); | |
| config.resolve.extensions.push(".ts", ".tsx"); | |
| // cacheDirectory option is unavailable in case of useBabel option | |
| const fixBabelConfig = omit(defaultLoaders.babel.options, [ |
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 CheckerPlugin = require("awesome-typescript-loader").CheckerPlugin; | |
| module.exports = { | |
| webpack(config, options) { | |
| const { dir, defaultLoaders } = options | |
| config.pageExtensions.push(".ts", ".tsx"); | |
| config.resolve.extensions.push(".ts", ".tsx"); | |
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
| open Js.Promise; | |
| type state('a) = { | |
| data: option('a), | |
| isLoading: bool, | |
| }; | |
| type action('a) = | |
| | Load | |
| | Loaded('a); |
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
| void Main() | |
| { | |
| var c = new ConfigStuff(new ConfigResolver()); | |
| c.GetNormalized().Dump(); | |
| } | |
| // Define other methods and classes here | |
| class ConfigStuff { | |
| private readonly Lazy<object> _configNormalizedLazy; | |
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 System; | |
| using System.Globalization; | |
| using System.Linq; | |
| using System.Runtime.InteropServices; | |
| using System.Text; | |
| using System.Windows.Forms; | |
| namespace KeyFinder | |
| { | |
| class Program |
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
| // DISCLAIMER | |
| // Original function was updated to a faster and es5-supporting version by @Quacky2200 | |
| var replaceCircular = function(val, cache) { | |
| cache = cache || new WeakSet(); | |
| if (val && typeof(val) == 'object') { | |
| if (cache.has(val)) return '[Circular]'; |
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 { useReducer, Reducer, useRef, useEffect } from "react"; | |
| export type RemoteDataState<T> = | |
| | { type: "initial" } | |
| | { type: "loading" } | |
| | { type: "error"; error: Error } | |
| | { type: "complete"; payload: T }; | |
| export type RemoteDataAction<T> = | |
| | { type: "beginLoad" } |
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
| /* eslint-disable no-console */ | |
| import React, { | |
| useContext, | |
| useEffect, | |
| useCallback, | |
| useMemo, | |
| useRef, | |
| } from 'react'; | |
| type LockId = number & { readonly __brand: unique symbol }; |
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 { noop, omit } from 'lodash'; | |
| import { getCLS, getFCP, getFID, getLCP, getTTFB, ReportHandler } from 'web-vitals' | |
| type IEntryType = 'navigation' | 'resource' | 'paint' | 'measure' | string; | |
| type IAppPerformanceMeasure = 'clientHydration' | 'ssrHydration' | string; | |
| type IAppPerformanceMark = | |
| | 'clientHydrateBegin' | |
| | 'clientHydrateEnd' |
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
| # Paste in your .bashrc/.zshrc | |
| # Change to your color presets | |
| ITERM2_DARK_PRESET='OneHalfDark' | |
| ITERM2_LIGHT_PRESET='OneHalfLight' | |
| theme=`defaults read -g AppleInterfaceStyle` &>/dev/null | |
| if [ "$theme" = 'Dark' ] ; then | |
| theme='dark' |