Skip to content

Instantly share code, notes, and snippets.

View enesien's full-sized avatar

Gavin D. Johnsen enesien

View GitHub Profile
@enesien
enesien / useCapacitor.ts
Last active October 25, 2023 15:43
Capacitor initialization hook for React or Next.js apps
import { Capacitor } from "@capacitor/core";
import { Device } from "@capacitor/device";
import { SplashScreen } from "@capacitor/splash-screen";
import { StatusBar, Style } from "@capacitor/status-bar";
import { useState, useEffect } from "react";
interface CapacitorHookOptions {
color: string;
iosStyle: 'dark' | 'light';
androidStyle: 'dark' | 'light';
@enesien
enesien / images.ts
Last active October 23, 2023 18:49
Resize images in any Typescript project within the client, including Capacitor native apps
interface ResizeOptions {
/**
* Desired width of the image.
*/
width: number;
/**
* Desired height of the image.
*/
height: number;
/**
@enesien
enesien / shadcn-multi-tag-input.md
Last active October 4, 2024 03:10
shadcn multiple tag input

shadcn/ui multi tag input component

A react tag input field component using shadcn, like one you see when adding keywords to a video on YouTube. Usable with Form or standalone.

Preview

image

Standalone Usage