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 nextConfig = { | |
| webpack: function (config, options) { | |
| config.module.rules.push({ | |
| test: /\.mp4$/, | |
| use: [ | |
| { | |
| loader: "file-loader", | |
| options: { | |
| name: "[name].[ext]", | |
| outputPath: "static/media", |
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 DisableEvent(e) { | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| return false; | |
| } | |
| new MutationObserver(function(e) { | |
| let isMobile = window.innerWidth - document.body.offsetWidth < 10; | |
| if (e[0].target.classList.contains("live")) { | |
| if (isMobile) |
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
| <?php | |
| add_image_size( 'image-480', 480, 9999 ); | |
| add_image_size( 'image-640', 640, 9999 ); | |
| add_image_size( 'image-720', 720, 9999 ); | |
| add_image_size( 'image-960', 960, 9999 ); | |
| add_image_size( 'image-1168', 1168, 9999 ); | |
| add_image_size( 'image-1440', 1440, 9999 ); | |
| add_image_size( 'image-1920', 1920, 9999 ); |
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
| PROBLEM: nodemon does not working inside docker container | |
| sample errors: | |
| [name] exited with code 243 | |
| [name] exited with code 127 | |
| e.g. | |
| SOLUTION: | |
| install nodemon globally inside the container and do not run it with npx but directly |
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 React, { ReactNode } from 'react' | |
| // Next | |
| import Link from 'next/link' | |
| import { useRouter } from 'next/router' | |
| const SomeComponent = () => { | |
| const router = useRouter(); | |
| 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
| export type InspectRulesArgs<T extends (...args: any) => any> = | |
| | T[] | |
| | [T, ...Parameters<T>][]; | |
| export type InspectRulesResult = "pending" | "approved" | "denied"; | |
| declare const brand: unique symbol; | |
| type Branded<T, Brand extends string> = T & { | |
| [brand]: Brand; | |
| } |
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
| In the .eslintrc file add the following: | |
| extends: ['prettier'] and plugins: ['prettier'] | |
| rules: {'prettier/prettier': ['error', {endOfLine: 'auto'}]} | |
| In .prettierrc remove this: | |
| endOfLine: 'auto' | |
| It works for me. |
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
| // https://ihateregex.io/expr/emoji/ | |
| export const emojiRegExpString = | |
| '(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])' | |
| export const emojiToUnified = (emoji: string) => | |
| [...emoji].map((e) => e.codePointAt(0)?.toString(16)).join('-') | |
| export const unifiedRegExpString = '\b([da-fA-F]{4,5}|[da-fA-F]{6}|[da-fA-F]{8})\b' | |
| export const unifiedToEmoji = (unified: 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
| /* | |
| This is the solution to the following error: | |
| Property 'em-emoji' does not exist on type 'JSX.IntrinsicElements'.ts(2339) | |
| */ | |
| // Define em-emoji web component inside React | |
| // https://github.com/missive/emoji-mart#-emoji-component | |
| interface EmEmojiProps { | |
| id?: string | |
| shortcodes?: 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
| // This problem occurs when using reactjs-social-login with a SSR metaframework. | |
| // The solution below is for Next.JS. Your framework may do dynamic imports differently. | |
| const LoginSocialInstagram = dynamic( | |
| () => import('reactjs-social-login').then((lib) => lib.LoginSocialInstagram), | |
| { ssr: false } | |
| ); |
OlderNewer