Skip to content

Instantly share code, notes, and snippets.

View 3ru's full-sized avatar
❄️
Waitin' 2045

Ryuya 3ru

❄️
Waitin' 2045
  • USC
  • Los Angeles
  • 16:48 (UTC -07:00)
View GitHub Profile
@3ru
3ru / fileCreator.ts
Created March 26, 2023 12:45
Function to create files and directories simultaneously using the fs package.
import fs from 'fs/promises'
/**
* Create files recursively if no directory.
*/
export const createFile = async (
data: string,
filePath: string,
): Promise<void> => {
try {
@3ru
3ru / ReactP5Wrapper.tsx
Last active March 26, 2023 12:47
React p5 wrapper on Nextjs
import dynamic from 'next/dynamic';
import { P5WrapperProps } from 'react-p5-wrapper';
import { NamedExoticComponent } from 'react';
const importReactP5Wrapper = async () => {
const module = await import('react-p5-wrapper');
return module.ReactP5Wrapper as NamedExoticComponent<P5WrapperProps>;
};
export const ReactP5Wrapper = dynamic(importReactP5Wrapper, {
@3ru
3ru / .commit_template
Last active April 9, 2021 04:00
🐲 Emoji prefix
# ==== Prefix ====
# init
# feat
# fix
# refactor
# docs
# des
# remove
JavaScript 5 hrs 33 mins ███████████▌░░░░░░░░░ 54.8%
TypeScript 2 hrs 48 mins █████▊░░░░░░░░░░░░░░░ 27.7%
Markdown 34 mins █▏░░░░░░░░░░░░░░░░░░░ 5.7%
YAML 28 mins ▉░░░░░░░░░░░░░░░░░░░░ 4.7%
JSON 23 mins ▊░░░░░░░░░░░░░░░░░░░░ 3.9%