Skip to content

Instantly share code, notes, and snippets.

View muhrusdi's full-sized avatar
Writing Code

Muhammad Rusdi muhrusdi

Writing Code
View GitHub Profile
@muhrusdi
muhrusdi / menus.html
Created June 28, 2023 11:52
Hover tailwindcss
<!--
Inverse Focus Navigation Menu
Created by Surjith S M
https://twitter.com/surjithctly
Buy Handbook: https://dub.sh/handbook
-->
<div class="relative flex min-h-screen flex-col overflow-hidden bg-gray-50">
<img src="/img/beams.jpg" alt="" class="absolute left-1/2 top-1/2 max-w-none -translate-x-1/2 -translate-y-1/2" width="1308" />
@muhrusdi
muhrusdi / Infinte Marquee Scrolling.html
Created June 21, 2023 07:58
Infinte Marquee Scrolling
<!--
Infinte Marquee Scrolling
Created by Surjitb S M
https://twitter.com/surjithctly
-->
<div class="relative flex min-h-screen flex-col justify-center overflow-hidden bg-gray-50 py-6 sm:py-12">
<img src="/img/beams.jpg" alt="" class="absolute top-1/2 left-1/2 max-w-none -translate-x-1/2 -translate-y-1/2" width="1308" />
<div class="absolute inset-0 bg-[url(/img/grid.svg)] bg-center [mask-image:linear-gradient(180deg,white,rgba(255,255,255,0))]"></div>
@muhrusdi
muhrusdi / ramdom.js
Created June 21, 2023 07:13
RANDOM COLOR
const getRandomColor = () =>
"#" + Math.floor(Math.random() * 16777215).toString(16);
@muhrusdi
muhrusdi / rsa-encrypt.js
Created June 12, 2023 06:27
RSA Encrypt
const crypto = require('crypto');
// const { privateKey, publicKey } = crypto.generateKeyPairSync('rsa', {
// modulusLength: 2048,
// publicKeyEncoding: {
// type: "pkcs1",
// format: "pem",
// },
// privateKeyEncoding: {
// type: "pkcs1",
import { Controller, get, Message, useFormContext } from "react-hook-form"
import { FormElement, Input as NextInput, InputProps } from "@nextui-org/react"
import { helperText } from "@/utils/constants"
import { PatternType } from "@/types"
import { useIMask } from "react-imask"
import React, { MutableRefObject, useState } from "react"
type Props = {
pattern?: PatternType
message?: string
import { Listbox, Transition } from "@headlessui/react"
import { Button } from "@nextui-org/react"
import { Fragment, useState } from "react"
import { FiChevronDown } from "react-icons/fi"
import cn from "classnames"
import { Controller, get, useFormContext } from "react-hook-form"
import { PatternType, RoleMapType } from "@/types"
import { helperText } from "@/utils/constants"
type LocalSelectProps = {
git config --global --add safe.directory G:/software/star-project/storybook-static
Get first/second slash
^\/[^/]+\/([^/]*) -> "/path/path2/path3/path4" -> ["/path/path2"]
const months = useMemo(() => {
return new Array(12).fill(null).map((n, i) => {
return format(new Date(new Date().getFullYear(), i), "MMM")
})
}, [])
const years = useMemo(() => {
const y = new Array(10).fill(null)
const min = new Date().getFullYear() - y.length
return y
You may use this regex with multiple
symbol is required: /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/
symbol is not requreid: /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-_]).{8,}$/