Skip to content

Instantly share code, notes, and snippets.

View naijab's full-sized avatar
🚀
Working from home

Nattapon Pondongnok naijab

🚀
Working from home
View GitHub Profile
@adlerdias
adlerdias / settings.json
Created April 1, 2020 16:53
visual studio code settings.json -> search.exclude
"search.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/tmp": true,
"**/node_modules": true,
"**/bower_components": true,
// Hide everything in /public, except "index.php"
@dimitrinicolas
dimitrinicolas / README.md
Last active December 18, 2023 11:42
Handle mouse down/up and click events once with React Hooks

Handle mouse down/up and click events once with React Hooks

The issue

Sometimes you need to make a button clickable with click and mouse down or mouse up actions.

The first solution that comes to mind would be to add only one event listener onMouseDown/onMouseUp but without an onClick event listener the element is not accessible anymore. It's now hard to click for people with disabilities or with keyboard navigation.

If we set both onMouseDown/onMouseUp and onClick event listeners, the common click handler function would be called twice with a mouse. So we have

@naijab
naijab / command.md
Last active April 8, 2020 09:32
Network I Lab

Display for check setting

  • display vlan <number of vlan>

    ex. display vlan 100

Set IP Address of Switch

  1. system-view and enter for enter setting mode
  2. interface vlan 1 and enter for setting vlan
  3. ip address <ip> <netmask>

    ex. ip address 192.168.1.5 24

@pjobson
pjobson / clover_boot_flags.md
Last active March 27, 2023 17:53
Clover Boot Flags

Clover Boot Flags

Flag Description
-v Verbose Mode
-x Safe Mode
-s Single User Mode
-no-zp Zone Postponing (use if hanging)
cpus=1 Single CPU Core Mode
-f No Kext Cache Mode (use if hanging)
@xuannghia
xuannghia / Initial-Server-CentOS-7.md
Last active October 28, 2020 19:58
Initial Server CentOS 7 - with NGINX, PHP 7.2, MariaDB 10.2, PostgreSQL 10 ,phpMyAdmin 4.8, MongoDB, Redis, Python3.6, NodeJS 10.15.3

1. Add Repositories

EPEL repository

sudo yum install -y epel-release

SCLo Software collections Repository

yum -y install centos-release-scl-rh centos-release-scl

Remi repository

@pmkay
pmkay / top-brew-packages.txt
Last active July 18, 2024 08:17 — forked from r5v9/top-brew-packages.txt
Top homebrew packages
node: Platform built on V8 to build network applications
git: Distributed revision control system
wget: Internet file retriever
yarn: JavaScript package manager
python3: Interpreted, interactive, object-oriented programming language
coreutils: GNU File, Shell, and Text utilities
pkg-config: Manage compile and link flags for libraries
chromedriver: Tool for automated testing of webapps across many browsers
awscli: Official Amazon AWS command-line interface
automake: Tool for generating GNU Standards-compliant Makefiles

1. SYSTEM

$ uname –a                          # Display linux system information
$ uname –r                          # Display kernel release information (refer uname command in detail)
$ hostname                          # Show system host name
$ hostname -i                       # Display the IP address of the host (all options hostname)
$ uptime                            # Show how long system running + load (learn uptime command)
$ last reboot                       # Show system reboot history (more examples last command)
$ cat /etc/redhat_release           # Show which version of redhat installed 

$ date # Show the current date and time (options of date command)

@mkjiau
mkjiau / axios-interceptors-refresh-token.js
Last active March 13, 2024 10:59
Axios interceptors for token refreshing and more than 2 async requests available
let isRefreshing = false;
let refreshSubscribers = [];
const instance = axios.create({
baseURL: Config.API_URL,
});
instance.interceptors.response.use(response => {
return response;
}, error => {
@ywwwtseng
ywwwtseng / host-react-app-on-apache-server.md
Last active July 4, 2024 19:28
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

@culttm
culttm / axios.refresh_token.js
Created October 5, 2017 18:46
axios interceptors for refresh token
axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
const originalRequest = error.config;
if (error.response.status === 401 && !originalRequest._retry) {
originalRequest._retry = true;