Skip to content

Instantly share code, notes, and snippets.

View zakiego's full-sized avatar

M. Zakiyuddin Munziri zakiego

View GitHub Profile
---
description:
globs:
alwaysApply: true
---
# Client Development Guidelines
## UI Component Library
**ALWAYS check the UI component library FIRST** before creating new components or using HTML elements directly.
export interface Welcome {
count: number;
next: string;
previous: null;
results: Result[];
}
export interface Result {
anggotaid: number;
umur: number | null;
@zakiego
zakiego / clean.yml
Created July 9, 2024 11:26
Digital Ocean Docker Registry Cleaner
# .github/workflows/clean.yml
name: Clean up Docker Registry
on:
schedule:
- cron: "0 0 * * *" # every day, see https://crontab.guru
env:
DOCKER_REGISTRY: "your-docker-registry"
function fckYou() {
var hiddenElements = document.querySelectorAll('[style="display: none;"]');
// Loop through all hidden elements starting from the second one (index 1)
for (var i = 1; i < hiddenElements.length; i++) {
hiddenElements[i].style.cssText = ''; // Set the style to empty
}
}
fckYou()
function vote(rating) {
const selector = `[data-rating-value="${rating}"]`;
const elements = document.querySelectorAll(selector);
if (elements.length > 0) {
elements.forEach((element) => {
element.click();
console.log(`Clicked on rating ${rating}!`);
});
} else {
import { z } from "zod";
const mobilSchema = z.object({
type: z.literal("mobil"),
jumlahPenumpang: z.number().min(1).max(6),
});
const motorSchema = z.object({
type: z.literal("motor"),
jumlahPenumpang: z.number().min(1).max(2),
@zakiego
zakiego / JSONViewer.tsx
Last active June 7, 2023 03:50
Keyboard Shortcut JSON Viewer
import { JsonViewer } from "@textea/json-viewer";
import { type FC, type KeyboardEvent, useEffect, useState } from "react";
interface Props {
code: unknown;
}
declare global {
interface WindowEventMap {
keydown: KeyboardEvent<HTMLInputElement>;
@zakiego
zakiego / install.md
Last active May 8, 2023 14:26
Install Keystatic on Next.js

Install Keystatic on Next.js

  1. Install dependencies
pnpm add @keystatic/core @keystatic/next
  1. Add Keystatic page to your Next.js app
@zakiego
zakiego / main.rs
Created March 25, 2023 18:08
Tauri Menubar App
// Prevents additional console window on Windows in release, DO NOT REMOVE!!
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command
#[tauri::command]
fn greet(name: &str) -> String {
format!("Hello, {}! You've been greeted from Rust!", name)
}
use tauri::{Manager, SystemTray, SystemTrayEvent, SystemTrayMenu};
@zakiego
zakiego / select.tsx
Last active March 15, 2023 15:30
Fix zIndex react-select and chakra-react-select problems in general, and related to the Accordion Chakra UI specifically
// "chakra-react-select": "^4.6.0"
<Select
menuPortalTarget={typeof window !== "undefined" && document.body}
menuShouldBlockScroll={true}
menuPosition="fixed"
// ... other props
/>
// https://stackoverflow.com/a/64973481