Skip to content

Instantly share code, notes, and snippets.

View iamparthaonline's full-sized avatar

Partha Roy iamparthaonline

View GitHub Profile
import { Resend } from 'resend';
import fetch from 'node-fetch';
import { getEmailTemplate } from './template';
const resend = new Resend(process.env.RESEND_API_KEY);
// Unified function
export const sendEmail = async ({
to,
subject,
import { Email } from 'meteor/email';
import { Meteor } from 'meteor/meteor';
// Common email layout function
const getCommonEmailLayout = (
content: string,
lang: 'en' | 'bn' = 'en'
): string => {
return `
<!doctype html>
import onnxruntime as ort
import numpy as np
import cv2
import os
import time
from datetime import datetime
import requests
import json
# === Configuration ===
// utils.js
export async function getUserData() {
const res = await fetch('https://jsonplaceholder.typicode.com/users/1')
return res.json()
}
// UserComponent.jsx
import { use } from 'react'
import { getUserData } from './utils'
// redux/api.js
import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'
export const api = createApi({
reducerPath: 'api',
baseQuery: fetchBaseQuery({ baseUrl: '/api' }),
tagTypes: ['Post'],
endpoints: (builder) => ({
getPosts: builder.query({
query: () => 'posts',
name: CI for Node Apps
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
/* add in you package json build script like this -
"build": "vite build && node bundle.js",
*/
import fs from "fs";
import archiver from "archiver";
import { DateTime } from "luxon";
var output = fs.createWriteStream("dist.zip");
var archive = archiver("zip");
import React, { useState } from "react";
import { DragDropContext, Droppable, Draggable } from "react-beautiful-dnd";
const listArray = {
Earth: [
{
label: "Iron Man",
id: 1001,
},
{
{
"name": "react-learning",
"version": "0.1.0",
"private": true,
"dependencies": {
"axios": "^0.27.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1"
import React from "react";
import axios from "axios";
class RegisterForm extends React.Component {
constructor() {
super();
this.state = {
name: "",
age: 0,
password: "",