Skip to content

Instantly share code, notes, and snippets.

View DungGramer's full-sized avatar
🔥
React, JS

Nguyễn Công Dũng DungGramer

🔥
React, JS
View GitHub Profile
{
"version": "2.0.0",
"tasks": [
{
"label": "Run docker-compose",
"type": "shell",
"command": "docker compose up -d",
"windows": {
"command": "docker-compose up -d"
},
(() => {
let gridSystem = document.querySelector("#grid-system");
if (gridSystem) {
gridSystem.remove();
document.querySelector('#grid-controller').remove();
return;
}
const grid = document.createElement("article");
grid.id = "grid-system";
let style = document.createElement("style");

SCSS: Started with static website

SASS: What, why, and how?

SASS is a CSS preprocessor that is designed to be used as a standalone preprocessor, or as part of a framework called Compass.
SASS for CSS is very similar to CSS, for creating CSS files that are more easily readable and maintainable than traditional CSS files.
In the next chapper, we will learn how to use SASS to create a simple CSS file.

Setup Project

npm init -y
@DungGramer
DungGramer / My Adguard Rule
Created April 26, 2022 09:46
My Adguard Rule
ybox.vn###app .article-right
ybox.vn###app .article-left
ybox.vn###app > div > div > div.page-container:nth-child(2) > div.page-content > div.content-wrapper > div.mt-20.spp-container > div.container-fluid.spp__content:nth-child(2) > div.post-detail > div.container-fluid.spp__content > div.row > div.col-sm-6.col-xs-12:nth-child(2) > div.d-flex.content.flex-column > div.panel > div.panel-body > div.mt-10.mb-10.hidden-xs:nth-child(6)
@DungGramer
DungGramer / fastest_for.js
Last active May 26, 2025 12:31
Find fastest way to loop through an array in Javascript
const {performance} = require('perf_hooks');
// Create 1000 random numbers
const arr = length =>
Array.from({length}, () => Math.floor(Math.random() * 1000));
function record(arr) {
const result = [];
function timeRun(callback, message) {
Config NeoVim for Windows
@DungGramer
DungGramer / getDomainName.js
Last active March 2, 2022 12:02
getDomainName
function getDomainName(url) {
if (!/^http|https|wss|ssh|ftp/i.test(url)) {
url = `http://${url}`;
}
let { hostname } = new URL(url);
hostname = hostname.split(".").filter(Boolean);
function getSuffixIndex(hostname) {
const Icann = ["com", "net", "org", "edu", "gov", "mil", "int"];
age sex bmi children smoker region charges
19 female 27.9 0 yes southwest 16884.924
18 male 33.77 1 no southeast 1725.5523
28 male 33 3 no southeast 4449.462
33 male 22.705 0 no northwest 21984.47061
32 male 28.88 0 no northwest 3866.8552
31 female 25.74 0 no southeast 3756.6216
46 female 33.44 1 no southeast 8240.5896
37 female 27.74 3 no northwest 7281.5056
37 male 29.83 2 no northeast 6406.4107
@DungGramer
DungGramer / fetcher.js
Last active September 4, 2021 04:07
Simple fetch snippet for Chrome
async function fetcher(
url,
method = 'get',
body = undefined,
headers = {
'Content-Type': 'application/json',
},
) {
try {
const response = await fetch(url, {
Using Git Bash for run if using Windows
Ex: addComponent.sh pages/dropdown-menu
--> src/components/pages/dropdown-menu
.
|-- DropdownMenu.jsx
`-- DropdownMenu.module.scss