Skip to content

Instantly share code, notes, and snippets.

/**
* hide all elements specified
* @example
* hideElement(document.querySelectorAll('img')); // Hides all <img> elements on the page
* @param {...any} el
*/
const hideElement = (...el) =>
[...el].forEach((e) => (e.style.display = "none"));
/**
@xuandinhgl
xuandinhgl / limit-memory-cpu-wsl.md
Created May 8, 2021 01:48
WSL2 Tips: Limit CPU/Memory When using Docker

Turn off all wsl instances such as docker-desktop

wsl --shutdown notepad "$env:USERPROFILE/.wslconfig"

Edit .wslconfig file with notepad and write down these settings:

[wsl2]

memory=3GB # Limits VM memory in WSL 2 up to 3GB

@xuandinhgl
xuandinhgl / apache-config.md
Created August 18, 2021 02:02
Change htaccess file name Apache
  1. Copy .httacess cp public/.htaccess public/.htaccess_local
  2. Add config vi /etc/httpd/conf/httpd.conf add code bellow AccessFileName .htaccess_local
  3. Restart Apache systemctl restart httpd
@xuandinhgl
xuandinhgl / wsl2-docker-ce.md
Last active April 26, 2022 09:00
WSL2 + Ubuntu 20.04 + Docker

Update

sudo apt update && sudo apt upgrade -y
sudo apt install -y software-properties-common apt-transport-https ca-certificates build-essential

Cài đặt docker (Community Edition)

@xuandinhgl
xuandinhgl / install-zsh-on-ubuntu-wsl.md
Last active April 26, 2022 09:27
Install ZSH Ubuntu WSL Window terminal

Install zsh

sudo apt install zsh

Install oh my zsh

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Active Agnoster theme