Skip to content

Instantly share code, notes, and snippets.

View abdmmar's full-sized avatar
😼

Abdullah Ammar abdmmar

😼
View GitHub Profile
@abdmmar
abdmmar / profile.ps1
Created February 3, 2024 08:02
PowerShell Profile that use oh-my-posh , terminal icons, autocomplete, history, and custom aliases
# Setup
## https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/zash.omp.json
oh-my-posh --init --shell pwsh --config ~/zash.omp.json | invoke-expression
# Modules
## Terminal-Icons
Import-Module -Name Terminal-Icons
Import-Module PSReadLine
@abdmmar
abdmmar / Evolusi Arsitektur Backend di Blibli PZN Reaction.srt
Last active November 15, 2023 07:49
Transcript of Evolusi Arsitektur Backend di Blibli PZN Reaction using faster-whisper on GTX 1050 4GB using CUDA with compute type int 8.
1
00:00:01,180 --> 00:00:15,480
evolusi arsitektur backend di blibli ini sebenarnya saya sendiri yang bikin ya tahun 2018 ya hampir 5 tahun yang lalu dan kayaknya sih waktu saya bikin artikel ini saya belum punya channel programmer jamano ya kalau gak salah
2
00:00:15,480 --> 00:00:26,300
programmer jamano itu channelnya kayak sekitar 2018 akhir gitu ya nah saya bikinnya jadi waktu itu dulu saya sebelum bikin channel youtube sebenarnya saya lebih senang nulis ya
3
00:00:26,300 --> 00:00:37,220
@abdmmar
abdmmar / Evolusi Arsitektur Backend di Blibli PZN Reaction.srt
Created November 15, 2023 07:41
Transcript of Evolusi Arsitektur Backend di Blibli PZN Reaction using faster-whisper on GTX 1050 4GB using CUDA with compute type int 8.
1
00:00:01,180 --> 00:00:15,480
evolusi arsitektur backend di blibli ini sebenarnya saya sendiri yang bikin ya tahun 2018 ya hampir 5 tahun yang lalu dan kayaknya sih waktu saya bikin artikel ini saya belum punya channel programmer jamano ya kalau gak salah
2
00:00:15,480 --> 00:00:26,300
programmer jamano itu channelnya kayak sekitar 2018 akhir gitu ya nah saya bikinnya jadi waktu itu dulu saya sebelum bikin channel youtube sebenarnya saya lebih senang nulis ya
3
00:00:26,300 --> 00:00:37,220
@abdmmar
abdmmar / form.test.tsx
Last active August 13, 2025 13:47
The integration test covers forms that utilize `react-hook-form`, `react-query`, `radix-ui` select, `react-select`, an input file component, and a custom hook. During the test, we mock the `useQuery` hook and the custom hook to ensure seamless and comprehensive testing of the form's functionality. Tested using Jest and React Testing Library
/* eslint-disable jest/prefer-spy-on */
import { cleanup, fireEvent, render, screen } from '@testing-library/react'
import userEvent from '@testing-library/user-event'
import { noop } from 'kyrim-ui'
import { wrapper } from '@/utils/test-utils'
import { companyInfo } from '../../utils/test'
import { CompanyInformationForm } from '../CompanyOnboardingForm/CompanyInformationForm'

Wordpress

Environment

Staging

Use WP Staging Plugins (limited feature) or manually configure in the CPanel settings

Production

@abdmmar
abdmmar / react-masonry-css.tsx
Created June 18, 2023 13:54
Masonry layout using React and CSS
import * as React from "react";
type MasonryProps = {
breakpoints?: (Record<number, number> & { default?: number }) | number;
gap?: string;
className?: string;
children: React.ReactNode;
};
const DEFAULT_COLUMNS = 4;
@abdmmar
abdmmar / codility.md
Last active April 22, 2023 13:52
Hal-hal yang saya temukan ketika mengerjakan latihan dari Codility

1. Binary Gap

Convert int to string menggunakan toString(2)

// 1
console.log((302).toString(2)) // 100101110

let n = 302
console.log(n.toString(2)) // 100101110
@abdmmar
abdmmar / company_industries.json
Created April 5, 2023 09:51
Company Industries
[
{
"label": "Education",
"options": [
{
"label": "Education Management",
"value": "education-management"
},
{
"label": "E-Learning",
@abdmmar
abdmmar / checkbox.tsx
Last active February 24, 2023 03:23
Checkbox implementation using Radix UI, Tailwind CSS, CVA, and Tailwind Merge
import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
import { Label } from '@radix-ui/react-label'
import { HiCheck } from 'react-icons/hi'
import { tm } from '@/lib' // custom tailwind merge
import { Prettify } from '@/lib/types' // types utility to make union type more readable
import {
checkboxContainerVariants,
checkboxVariants,
@abdmmar
abdmmar / tailwind-colors-scrap.ts
Created July 16, 2022 19:05
Get Tailwind Colors
const colorsValue = Array.from(document.querySelectorAll("div.px-0\\.5.md\\:flex.md\\:justify-between.md\\:space-x-2.\\32 xl\\:space-x-0.\\32 xl\\:block")).map(node => node.textContent)
const colorsName = Array.from(document.querySelectorAll('.text\\-sm.font\\-semibold.text\\-slate\\-900.dark\\:text\\-slate\\-200')).map(node => node.textContent)
let colorsValueCount = 0
let colorsNameIndex = 0
let colors = {}
const setColor = (name, value) => {
let [valueNum, valueRGB] = value.split("#")