Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
kuc-arc-f / index.html
Created October 11, 2024 05:41
Server-Sent Events, Express.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SSE Example</title>
</head>
<body>
<h1>Server-Sent Events (SSE)</h1>
<div id="messages"></div>
@kuc-arc-f
kuc-arc-f / test2pub.ts
Created October 5, 2024 02:03
nodemailer , send example
import nodemailer from 'nodemailer';
const GOOGLE_MAIL_USER = "your_email@gmail.com";
const GOOGLE_MAIL_PASSWORD = "123";
const TO_MAIL= "recipient_email@example.com";
//
async function sendMail() {
// SMTPトランスポートの設定
const transporter = nodemailer.createTransport({
service: 'gmail',
@kuc-arc-f
kuc-arc-f / Test2.tsx
Created June 13, 2024 12:07
Remix + mermaid.js sample
import type { MetaFunction } from "@remix-run/node";
import React, { useEffect, useRef } from 'react';
import mermaid from 'mermaid';
//
type Props = {
src: string;
className?: string;
};
//
export function Mermaid({ src, className }: Props) {
@kuc-arc-f
kuc-arc-f / dialog5a.html
Last active May 15, 2024 10:38
dialog tag + tailwindcss, sample
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Page</title>
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-100">
<div class="container mx-auto my-2 px-8 py-8">
@kuc-arc-f
kuc-arc-f / test.tsx
Created February 27, 2024 10:18
Qwik, sample
import { component$, useSignal, useStore, useComputed$, useTask$, $ } from '@builder.io/qwik';
import './app.css'
//
const dataItems = [
{id:1 , title: "title_1"},
{id:2 , title: "title_2"},
{id:3 , title: "title_3"},
];
//
@kuc-arc-f
kuc-arc-f / .env
Last active January 24, 2024 11:35
vite.config.ts , react + vite, sample
VITE_API_KEY="123"
VITE_API_URL=http://localhost:4000
@kuc-arc-f
kuc-arc-f / .env
Last active January 25, 2024 23:14
vite.config.ts, svelte sample
VITE_API_URL="http://localhost:4000"
VITE_API_KEY=""
@kuc-arc-f
kuc-arc-f / vite.config.ts
Created January 15, 2024 09:33
vite.config.ts, svelte + vite sample
import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [svelte()],
build: {
lib: {
entry: [
'./src/main.ts',
@kuc-arc-f
kuc-arc-f / vite.config.ts
Created January 14, 2024 03:44
Vue.js vite.config.ts, sample
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
define: {
"process.env.NODE_ENV": '"production"',
},
build: {
@kuc-arc-f
kuc-arc-f / logger.js
Last active December 16, 2023 23:45
log4js, setting sample
const log4js = require("log4js");
let dt = Date.now();
let LOG_FILE_NAME = "log_" + dt;
console.log("dt=", dt);
//
log4js.configure({
appenders: {
cheese: { type: "file", filename: "cheese.log" } ,
app: { type: "file", filename: `log/${LOG_FILE_NAME}.log` }