Skip to content

Instantly share code, notes, and snippets.

View lamualfa's full-sized avatar
😆
Set your status

Laode Muhammad Al Fatih lamualfa

😆
Set your status
View GitHub Profile
@lamualfa
lamualfa / asus-wmi-screenpad-ubuntu-installation.md
Last active September 8, 2023 07:02
Install Asus WMI Screenpad Module on Ubuntu

Important

Please disable the Secure Boot before running the following commands.


1. Install the prerequisite packages (skip if already installed)

sudo apt install dkms
@lamualfa
lamualfa / use-is-active-path.ts
Created August 1, 2023 17:07
Hook to check is path active or no in React Router v6
import { LinkProps, useMatch, useResolvedPath } from 'react-router-dom'
export function useIsActivePath(path: LinkProps['to'], strict = true) {
const resolvedPath = useResolvedPath(path)
const match = useMatch({ path: resolvedPath.pathname, end: strict })
return match !== null
}
@lamualfa
lamualfa / get-translated-voyager-menu-items.md
Last active December 8, 2022 16:02
Get translated Voyager Menu Items

Get translated Voyager Menu Items

According to this Voyager issue thedevdojo/voyager#3835, the author says there's no built-in function to translate the Voyager menu items. You need to write a custom function to solve it manually.

I've created a function to translate Voyager menu items for you. So you don't need to write it again.

Function to translate Voyager menu items

<?php
@lamualfa
lamualfa / add-nprogress-to-svelte-kit-project.md
Last active October 12, 2021 07:21
Add NProgress to Svelte Kit project

Step

  1. Install nprogress:
npm i nprogress
  1. Put the below code in the src/routes/__layout.svelte (or something else).