Skip to content

Instantly share code, notes, and snippets.

View trinhvanminh's full-sized avatar
🎲
haha

Minh trinhvanminh

🎲
haha
  • Ho Chi Minh City, Viet Nam
View GitHub Profile
import { defineConfig, loadEnv } from '@rsbuild/core';
// import { pluginEslint } from '@rsbuild/plugin-eslint';
import { pluginReact } from '@rsbuild/plugin-react';
import { pluginSass } from '@rsbuild/plugin-sass';
import { pluginSvgr } from '@rsbuild/plugin-svgr';
import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
const { publicVars, rawPublicVars } = loadEnv({ prefixes: ['REACT_APP_'] });
export default defineConfig({
@trinhvanminh
trinhvanminh / README.md
Last active December 27, 2024 11:09
Mocks Server
  1. Install npm i -D @mocks-server/main

  2. Add script

"scripts": {
    "mocks": "mocks-server",
},
@trinhvanminh
trinhvanminh / README.md
Created December 9, 2024 04:12 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@trinhvanminh
trinhvanminh / isEllipsisActive.js
Created November 20, 2024 02:51
Detect CSS Ellipsis in JavaScript and add a title. https://jsfiddle.net/tzi/qtqnqomL/
// https://jsfiddle.net/tzi/qtqnqomL/
function isEllipsisActive(element) {
return element.offsetWidth < element.scrollWidth;
}
Array.from(document.querySelectorAll('.ellipsis'))
.forEach(element => {
if (isEllipsisActive(element)) {
element.title = element.innerText;
@trinhvanminh
trinhvanminh / Container.module.scss
Last active December 9, 2024 03:55
Auto Grid with props xs, ... as a List. GridLayout, GridContainer, GridItem, Container (based on Mui Grid v2, Mui Container)
// Import the variables file to access the breakpoints and other variables
@import './variables';
/* Base container styles */
.root {
width: 100%;
margin-left: auto;
margin-right: auto;
padding-left: $container-padding-x;
padding-right: $container-padding-x;
@trinhvanminh
trinhvanminh / tinh_lai_suat_kep.py
Last active August 14, 2024 15:17
Tính lãi suất kép
import matplotlib.pyplot as plt
lai_suat_theo_ky_han = [
{
"ky_han": 1,
"lai_suat": 0.037
},
{
"ky_han": 2,
"lai_suat": 0.038
@trinhvanminh
trinhvanminh / removeHolaVPNOverlay.js
Last active June 5, 2024 08:10
remove Hola VPN extension loading time overlay, without need to wait
// ==UserScript==
// @name remove Hola VPN overlay
// @namespace http://tampermonkey.net/
// @version 2024-06-05
// @description try to take over the world!
// @author You
// @match https://*.medium.com/*
// @match *://*/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=medium.com
// @grant none
:root {
--text-gradient-stop-1: #4285f4;
--text-gradient-stop-2: #9b72cb;
--text-gradient-stop-3: #d96570;
--color-surface: #fff;
}
div {
background: linear-gradient(
74deg,
/* end here (2) */ var(--text-gradient-stop-1) 0,
@trinhvanminh
trinhvanminh / git-branch-command-multiple-respo.cmd
Created September 22, 2023 04:16
Work with multiple git repository. Enter branch, enter git command and let it work.
@echo off
set /p branch=Branch (master):
set /p git_command=Git command (fetch):
if "%branch%"=="" set branch=master
if "%git_command%"=="" set git_command=fetch
for /d %%i in (%cd%\*) do (
echo *************************************************************************
const getState = () => {
if (document.visibilityState === 'hidden') {
return 'hidden';
}
if (document.hasFocus()) {
return 'active';
}
return 'passive';
};