Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -euo pipefail
UI_LIB_URL="https://gist.githubusercontent.com/kotsutsumi/e3cbc37fd9f071dddd79c2edfe4013c9/raw/2815b20b2f47a97e3091d0f0546a06179ca6e28f/pure-bash-ui.sh"
TURSO_SETUP_URL="https://gist.githubusercontent.com/kotsutsumi/38561b527e98e288177d9f6f1f3592fa/raw/0a07e4db60d542d864785f38cfe7a36dfd65bd0c/turso-setup.sh"
__fetch_and_source_ui() {
local cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/pure-bash-ui"
mkdir -p "$cache_dir"
local dst="$cache_dir/ui.$(printf '%s' "$UI_LIB_URL" | sha1sum | awk '{print $1}').sh"
#!/usr/bin/env bash
set -euo pipefail
UI_LIB_URL="https://gist.githubusercontent.com/kotsutsumi/e3cbc37fd9f071dddd79c2edfe4013c9/raw/2815b20b2f47a97e3091d0f0546a06179ca6e28f/pure-bash-ui.sh"
NEXTJS_SETUP_URL="https://gist.githubusercontent.com/kotsutsumi/8e60f41dc85e73d79d48a3d42baf990b/raw/8d8b6a2c5813968e444083db6ae284d61c4d8caa/nextjs-setup.sh"
PRISMA_VERSION="^6.16.0"
__fetch_and_source_ui() {
local cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/pure-bash-ui"
mkdir -p "$cache_dir"
#!/usr/bin/env bash
set -euo pipefail
UI_LIB_URL="https://gist.githubusercontent.com/kotsutsumi/e3cbc37fd9f071dddd79c2edfe4013c9/raw/2815b20b2f47a97e3091d0f0546a06179ca6e28f/pure-bash-ui.sh"
__fetch_and_source_ui() {
local cache_dir="${XDG_CACHE_HOME:-$HOME/.cache}/pure-bash-ui"
mkdir -p "$cache_dir"
local dst="$cache_dir/ui.$(printf '%s' "$UI_LIB_URL" | sha1sum | awk '{print $1}').sh"
#!/usr/bin/env bash
# pure-bash-ui.sh — 依存ゼロのUI関数集
# v0.1.0
# ===== 色・装飾 =====
if command -v tput >/dev/null 2>&1 && [ -t 1 ]; then
__BOLD="$(tput bold)"; __DIM="$(tput dim)"; __RESET="$(tput sgr0)"
__RED="$(tput setaf 1)"; __GREEN="$(tput setaf 2)"; __YELLOW="$(tput setaf 3)"; __BLUE="$(tput setaf 4)"; __CYAN="$(tput setaf 6)"
else
__BOLD=""; __DIM=""; __RESET=""; __RED=""; __GREEN=""; __YELLOW=""; __BLUE=""; __CYAN=""
@kotsutsumi
kotsutsumi / context-menu.tsx
Last active October 28, 2024 09:32
context-menu.tsx
'use client'
/**
* ContextMenu Component
*/
import { css } from 'styled-system/css'
function ContextMenu({ children, pos, onClose }: { children: React.ReactNode; pos: { x: number; y: number }; onClose?: () => void }) {
return (
<div
className={css({
@kotsutsumi
kotsutsumi / tabs.tsx
Last active October 28, 2024 12:14
Scrollable tabs with drag-and-drop reordering using ParkUI
'use client'
/**
* Tabs Component
*
* Scrollable tabs with drag-and-drop reordering and close button.
*
* npm install @dnd-kit/core @dnd-kit/sortable @dnd-kit/modifiers @dnd-kit/utilities --force
*/
import { ComponentProps, useEffect, useRef, useState } from 'react'
import { log } from 'console'
@kotsutsumi
kotsutsumi / theme-toggle-button.tsx
Last active October 26, 2024 17:33
ThemeToggleButton Component with ParkUI
'use client'
/**
* ThemeToggleButton Component
*
* npm install next-themes react-icons --force
*/
import { useTheme } from 'next-themes'
import { MdOutlineDarkMode, MdOutlineLightMode } from 'react-icons/md'
import { Button } from '../button'
@kotsutsumi
kotsutsumi / setup-nextjs-parkui.sh
Last active October 26, 2024 05:17
Next.js PandaCSS ArkUI ParkUI 一括セットアップスクリプト
# Next.jsへのセットアップ
# 作成するプロジェクト名を設定("next-app-現在時刻")
CREATE_NEXT_APP_NAME=`date +next-app-%y%m%d%H%M%S`
# CREATE_NEXT_APP_NAME="my-app"
# プロジェクト生成
npx create-next-app@latest ${CREATE_NEXT_APP_NAME} --ts --eslint --no-tailwind --app --src-dir src/ --no-import-alias --no-turbopack
# ディレクトリ移動
#!/usr/bin/bash
# ------------------------------------------------------------------------------
# [INFO]
# If you are not registered as sudoers, you will be asked for your password.
# ------------------------------------------------------------------------------
echo "🚀 A setup scripts for Ubuntu Desktop 22.04 LTS."
# ------------------------------------------------------------------------------
@kotsutsumi
kotsutsumi / .bash
Created March 18, 2023 03:22
Next.js Setup with PrimeReact and Firebase Authentication
#!/bin/bash
# オプション設定
NO_AUTH=0
NO_MYSQL=0
function main() {
local appName=$1
if [ -d $1 ]; then