Skip to content

Instantly share code, notes, and snippets.

View fanboykun's full-sized avatar
🏠
Working from home

fanboykun fanboykun

🏠
Working from home
View GitHub Profile
@fanboykun
fanboykun / artisan.js
Last active October 21, 2024 16:46
Sveltekit Artisan
/**
* CLI Tool for generating various types of files and folders for a SvelteKit project.
*
* This script automates the creation of common SvelteKit components such as layouts, pages, groups, components,
* and API routes, with support for generating additional files with flags.
*
* # Usage
*
* Run the script using `node`:
*
@fanboykun
fanboykun / cloudinary.ts
Last active October 21, 2024 10:43
code example to interact with cloudinary api in typescript and sveltekit
import { v2 as cloudinary } from 'cloudinary';
// get the environment variable, depends on your project.
// in this case, i use sveltekit with vite
import { VITE_CLOUDINARY_CLOUD_NAME, VITE_CLOUDINARY_KEY, VITE_CLOUDINARY_SECRET } from '$env/static/private'
cloudinary.config({
cloud_name: VITE_CLOUDINARY_CLOUD_NAME,
api_key: VITE_CLOUDINARY_KEY,
api_secret: VITE_CLOUDINARY_SECRET,
// secure: true