Skip to content

Instantly share code, notes, and snippets.

View enqtran's full-sized avatar

enqtran enqtran

View GitHub Profile
Descriptive: Naming Styles
There are a lot of different naming styles. It helps to be able to recognize what naming style is being used, independently from what they are used for.
The following naming styles are commonly distinguished:
b (single lowercase letter)
B (single uppercase letter)
lowercase
lower_case_with_underscores
UPPERCASE
# pull official base image
FROM node:14 AS builder
# set working directory
WORKDIR /app
# install app dependencies
#copies package.json and package-lock.json to Docker environment
COPY package.json ./
'git log' failed with code 1:'xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun'
'git status' failed with code 1:'xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun'
=> Fix :
- Open terminal
- Run: xcode-select --install
Three.js
Pixi.js
Phaser
Babylon.js
Matter.js
PlayCanvas
import { useLayoutEffect } from 'react'
import { useLocation } from 'react-router-dom'
const ScrollToTop = () => {
const { pathname } = useLocation()
useLayoutEffect(() => {
window && window.scrollTo(0, 0)
}, [pathname])
@enqtran
enqtran / V2
Last active January 18, 2023 14:30
JavaScript Library for building User Interfaces
React Community
https://stackoverflow.com/questions/tagged/reactjs
439,112 questions
https://twitter.com/reactjs
656,8 N Người theo dõi
https://github.com/facebook/react
npm config set fetch-retry-mintimeout 20000
npm config set fetch-retry-maxtimeout 120000
npm config ls -l
1. Install package "@svgr/cli", "@svgr/plugin-jsx"
2. Setup scripts build from svg (npm run svgr)
"svgr": "svgr --config-file .svgrrc.js -d src/assets/icons -- src/assets/icons"
3. Create file .svgrrc.js
module.exports = {
icon: false,
expandProps: true,
replaceAttrValues: { 'none': "currentColor" },
<VirtualHost *:80>
DocumentRoot /home/web/build/
<Directory"/home/web/build/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
import { useEffect, useRef } from "react"
/*
isMounted = useIsMounted()
useEffect(() => {
if (isMounted.current) {
// code...
}
}, [isMounted])
*/