Skip to content

Instantly share code, notes, and snippets.

View marzuk-zarir's full-sized avatar

Marzuk Zarir marzuk-zarir

View GitHub Profile
@marzuk-zarir
marzuk-zarir / .prettierrc
Created June 24, 2025 15:41
prettierrc configs for new project
{
"printWidth": 100,
"tabWidth": 4,
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"plugins": ["prettier-plugin-tailwindcss", "prettier-plugin-sort-imports"],
"importOrders": [
"^@/pages/(.*)$",
"^@/components/(.*)$",
@marzuk-zarir
marzuk-zarir / f.sh
Created March 9, 2024 17:09 — forked from LearnWebCode/f.sh
My fzf first draft
# You need to give this file permission to execute by doing the following...
# chmod +x f.sh
# Add an alias named f to your .zshrc file like this:
# alias f="/Users/brad/Documents/shell-scripts/f.sh"
code "$(find ~/Documents ~/Desktop ~/Sites ~/Local\ Sites -type d \( -name "node_modules" -o -name ".next" -o -name ".git" -o -name "vendor" -o -name "wp-includes" -o -name "wp-admin" \) -prune -o -type d | fzf)"
# todo someday
# currently it only searches for folders, but it would be nice if I could search for zshrc or specific files, but I'm not sure if that will include too many files and be slow...
@marzuk-zarir
marzuk-zarir / TranslatedText.jsx
Created March 11, 2023 06:59
Translate text to another language
import { useEffect, useState } from 'react'
import translate from 'translate'
import ChildComponent from './ChildComponent'
translate.engine = 'deepl'
translate.key = process.env.DEEPL_KEY
export default function TranslateText({ text }) {
const [translatedText, setTranslatedText] = useState()
@marzuk-zarir
marzuk-zarir / fix.txt
Created November 14, 2022 14:41
React input element losses focus while typing.
It is only happens when we loop over an array and render an input component with different key prop every time. When render the input component react see that I have a different key so he render the whole a new component on vdom. So, we can easily solve this problem by passing the same key (index of an array instead of uuid or something like this) every time.
@marzuk-zarir
marzuk-zarir / fix.txt
Created October 31, 2022 16:57
Fix duplicate dash to dock and other related issues in ubuntu after suspend or lock the screen
// it will fix duplicate dash and empty app icon in dash
sudo apt install gnome-shell-extensions
sudo gnome-extensions disable ubuntu-dock@ubuntu.com
@marzuk-zarir
marzuk-zarir / index.css
Created October 27, 2022 11:08
Remove blue overlay on button/anchor tag click in mobile device
/*
There is two ways to do that
option 1: add 'cursor: default;' for mobile device
option 2: add '-webkit-tap-highlight-color: transparent;' for elements
*/
/* option 1 */
@marzuk-zarir
marzuk-zarir / scrollbar.js
Created December 29, 2021 17:45 — forked from parafeu/scrollbar.js
Scrollbar plugin tailwindcss
const plugin = require("tailwindcss/plugin");
module.exports = plugin(function ({ addUtilities, matchUtilities, theme }) {
const scrollbarTrackColorValue = (value) => ({
'--scrollbar-track': value,
'&::-webkit-scrollbar-track': {
"background-color": value
}
})