분류 전체보기

· NextJS
JS - 어떤 문자가 쓰였는지 감지하기 작성일자 : 2025년 07월 06일 어떤 문자가 쓰였는지 감지하기 (ISO 15924) script.jsexport const scripts = [ { code: 'Latn', name: 'Latin' }, { code: 'Cyrl', name: 'Cyrillic' }, { code: 'Hang', name: 'Hangul' }, { code: 'Hani', name: 'Han (Hanzi)' }, { code: 'Arab', name: 'Arabic' }, { code: 'Deva', name: 'Devanagari' }, { code: 'Beng', name: 'Bengali' }, { code: 'Grek', name: 'Greek' }, {..
· NextJS
NextJS - Cloudflare Images 사용하기 작성 일자 : 2025년 06월 29일 components/ui/cloudflare-image.tsx "use client";import cloudflareLoader from "@/lib/cloudflareImageLoader";import NextImage, { type ImageProps } from "next/image";interface CloudflareImageProps extends ImageProps { ref?: (node: HTMLImageElement | null) => void;}export default function CloudflareImage({ ...props }: CloudflareImageProps) { re..
· 기타
Proxmox - 컨테이너 디스크 사이즈 증가시키기 작성 일자 : 2025년 06월 22일 Proxmox - 컨테이너 디스크 사이즈 증가시키기 1. Proxmox GUI에서 컨테이너 선택 Proxmox GUI에 접속하여, 왼쪽 메뉴에서 디스크 사이즈를 증가시키고자 하는 컨테이너를 선택합니다. Datacenter -> pve -> 디스크 사이즈를 증가시킬 컨테이너 선택 2. 컨테이너 Resources 선택 왼쪽 메뉴에서 선택한 컨테이너의 "Resources" 탭을 클릭합니다. 3. Root Disk 선택 후, 디스크 사이즈 증가 "Resources" 탭에서 "Root Disk"를 선택한 후, 상단의 "Volume Action" → "Resize" 버튼을 클릭합니다. 4. Resize 선택 팝업..
· NextJS
웹 클라이언트에서 국가 코드 추출하기 작성일자 : 2025년 06월 15일 country-detection.ts function getCountryFromLocale(): string | null { try { const locale = navigator.language || (navigator as any).userLanguage; if (locale && locale.includes('-')) { const countryCode = locale.split('-')[1]; return countryCode.toUpperCase(); } return null; } catch { return null; }}function getCountryFromTim..
· 기타
Git - git stash 사용 시, untracked file을 포함하기 작성 일자 : 2025년 05월 08일 Git Stash Git stash는 현재 작업 중인 변경 사항을 임시로 저장하고, 작업 디렉토리를 깨끗한 상태로 되돌리는 데 사용됩니다. 이 기능은 작업 중인 변경 사항을 보존하면서 다른 브랜치로 전환하거나, 다른 작업을 수행할 때 유용합니다. Untracked Files 포함하기 기본적으로 git stash 명령은 추적 중인 파일의 변경 사항만 저장합니다. 때문에 untracked files(추적되지 않는 파일)는 stash에 포함되지 않습니다. 하지만 git stash 명령에 --include-untracked 옵션을 추가하면 untracked files도 함께 저장할 수 있습니다..
· NextJS
NextJS - shadcn/ui Dialog 전체 화면 작성일자 : 2025년 05월 30일 방법 1: h-[100dvh] Open Are you absolutely sure? This action cannot be undone. This will permanently delete your account and remove your data from our servers. 방법 2: max-h-[100dvh] Open Are you absolutely sure? This action cannot be undone. This will permanently delete yo..
· NextJS
React - 모바일 Pull-to-Refresh 방지하기 작성일자 : 2025년 05월 25일 Pull-to-Refresh란? Pull-to-Refresh는 모바일 애플리케이션에서 사용자가 화면을 아래로 끌어당겨 새로 고침을 수행하는 기능입니다. 일반적으로 리스트나 피드를 새로 고침할 때 사용됩니다. Pull-to-Refresh 방지하기 PreventPullToRefresh 컴포넌트 생성하기 PreventPullToRefresh 컴포넌트는 모바일 환경에서 Pull-to-Refresh 기능을 비활성화하는 역할을 합니다. 이 컴포넌트를 사용하면 터치 이벤트를 감지하여 기본 동작을 방지할 수 있습니다.// PreventPullToRefresh.jsimport React, { useEffect } f..
· 기타
PostgreSQL - PostgreSQL 로컬 Docker 환경에서 pg_bigm 설치하기 작성 일자 : 2025년 05월 18일 pg_bigm 이란? pg_bigm은 PostgreSQL의 확장 모듈로, bigram(2-gram) 기반의 인덱스를 생성하여 전체 텍스트 검색 성능을 향상시키는 데 사용됩니다. 특히 한국어, 일본어 등 다중 바이트 문자를 사용하는 언어에서 효과적이며, LIKE '%검색어%'와 같은 중간 문자열 검색에서도 빠른 성능을 제공합니다. bi-gram 인덱스 생성: 문자열을 연속된 두 글자씩 분할하여 인덱스를 생성함으로써 빠른 검색을 지원합니다.다국어 지원: 한국어, 일본어 등 비알파벳 언어에 대한 검색 성능이 우수합니다.LIKE 연산자 최적화: LIKE '%검색어%' 형태의 ..
gerrymandering
'분류 전체보기' 카테고리의 글 목록