Skip to content

Instantly share code, notes, and snippets.

View k1-c's full-sized avatar
πŸ₯±
sleepy

KAY k1-c

πŸ₯±
sleepy
View GitHub Profile
@k1-c
k1-c / COMMIT.md
Last active August 18, 2025 11:35
Git Commit Guideline

πŸ“ Commit Message Policy

This document defines commit message conventions following the Conventional Commits specification with emoji prefixes.

🎯 Basic Format

<emoji> <type>[optional scope]: <description>

[optional body]
// Not good
const Page = () => (
<main className="bg-background">
<section className="p-6">
<h1 className="text-2l font-bold">A page title</h1>
<p className="text-md text-foreground">Content...</p>
<ul className="list-disc">
<li>List Item 1</li>
<li>List Item 2</li>
</ul>
@k1-c
k1-c / globals.css
Last active April 9, 2023 12:47
[node] [react] resolve reset css conflicts between tailwind and mantain
/* @tailwind base; */
/* Aboid conflict with Mantine
* Default Style Sheet (modern-normalize): https://unpkg.com/[email protected]/src/css/preflight.css
*/
/*
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
*/
*,
@k1-c
k1-c / useModal.tsx
Created March 7, 2023 01:27
[react] [hooks] use modal hook sample
import React, { useState } from 'react';
import { createPortal } from 'react-dom';
import { ModalCloseButton } from '@/components/buttons/ModalCloseButton/ModalCloseButton';
import { useClient } from '@/hooks/common/useClient';
const ModalPortal: React.FC = ({ children }) => {
const isClient = useClient();
return isClient ? createPortal(children, document.getElementsByTagName('body')[0]!) : <>{children}</>;
};
@k1-c
k1-c / package.json
Last active February 15, 2023 06:28
[node] [npm] [yarn] pre / post hook example at npm script
{
"name": "sample",
"version": "0.1.0",
"private": true,
"scripts": {
"schema:update": "npx openapi2aspida -i=docs/openapi.yml",
"predev": "schema:update"
"dev": "next dev",
"prebuild": "schema:update",
"build": "next build",
@k1-c
k1-c / .gitignore
Last active February 15, 2023 06:12
[node] [yarn] .yarn (later v2) gitignore to disable zero installation
# yarn / without zero install
# reference: https://github.com/yarnpkg/berry/issues/454
.yarn/*
!.yarn/plugins
!.yarn/releases
.pnp.*
@k1-c
k1-c / .yarnrc.yml
Last active February 15, 2023 06:12
[node] [yarn] yarnrc configuration to disable pnp
# Disable pnp to avoid conflicts with eslint / tsserver
nodeLinker: node-modules
@k1-c
k1-c / AppAccordion.vue
Last active February 15, 2023 06:11
[vue] [nuxt] [component] Vue Simple Accordion
<template>
<transition
name="slide"
@before-enter="(el) => (el.style.height = '0')"
@enter="(el) => (el.style.height = el.scrollHeight + 'px')"
@before-leave="(el) => (el.style.height = el.scrollHeight + 'px')"
@leave="(el) => (el.style.height = '0')"
>
<div v-if="isOpened" class="slide-body">
<slot />
@k1-c
k1-c / docker-compose.yml
Last active February 15, 2023 06:10
[docker-compose] PostgresSQL Quick Start
version: "3.8"
volumes:
db-store:
services:
db:
image: postgres:11-alpine
ports:
- target: 5432
published: ${DB_PORT:-5432}
protocol: tcp
@k1-c
k1-c / .gitignore
Last active February 15, 2023 06:09
[python] Python gitignore template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python