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 path = require('path'); | |
const CopyPlugin = require('copy-webpack-plugin'); | |
/** @type {import('next').NextConfig} */ | |
const nextConfig = { | |
reactStrictMode: true, | |
/** | |
* | |
* @param {import('webpack').Configuration} config | |
* @returns {import('webpack').Configuration} |
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 { composePlugins, withNx } = require('@nx/webpack'); | |
const Dotenv = require('dotenv-webpack'); | |
const fs = require('fs'); | |
const path = require('path'); | |
// check for available env file using Nx conventions and return the path | |
function resolveEnvFile(basePath = __dirname) { | |
const envFiles = [ | |
`.env.${process.env.NX_TASK_TARGET_CONFIGURATION}.${process.env.NX_TASK_TARGET_TARGET}`, |
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 MeiliSearch from 'meilisearch'; | |
export type WaitForTaskOptions = { | |
client: MeiliSearch; | |
taskUid: number; | |
retries?: number; | |
retryDelay?: number; | |
customErrorMessage?: string; | |
}; |
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 hrefMonkeyPatch = () => { | |
const originalCreateElement = React.createElement; | |
React.createElement = function createElement () { | |
const args = Array.prototype.slice.call(arguments); | |
if (!args[1]) { | |
args[1] = {}; | |
} |
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
#!/bin/bash | |
input_path=$1 | |
output_path=$2 | |
# Find all .env files in the input path | |
for file in $(find "$input_path" -name "*.env"); do | |
# Get the file path relative to the input path | |
relative_path="${file#$input_path/}" |
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
useEffect(() => { | |
// componentDidMount | |
}, []) | |
useEffect(() => { | |
// componentDidUpdate | |
}, [something, anotherThing]) | |
useEffect(() => { | |
return () => { |
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
arrayWithFalsyItems.filter(Boolean) |
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
// this file is just to set the name of the gist, use just one of the functions below | |
export * as withLuxon from './withLuxon' | |
export * as withMoment from './withMoment' | |
export * as withDateFns from './withDateFns' |