Skip to content

Instantly share code, notes, and snippets.

View MoeRayo's full-sized avatar

Moronfolu Olufunke E. MoeRayo

View GitHub Profile
<!-- public/index.html -->
<!DOCTYPE html>
<html>
<head>
<title>Push Notifications Demo</title>
<style>
body {
padding: 20px;
font-family: Arial, sans-serif;
}
//src/server.ts
import express, { Request, Response, NextFunction, RequestHandler } from 'express';
import webpush from 'web-push';
import { vapidKeys, EMAIL, PORT } from './config';
import { subscriptionService } from './services/subscriptionService';
import { NotificationRequest, SubscriptionRequest } from './types';
const app = express();
app.use(express.json());
{
"stores": [
"Walmart",
"Target",
"Costco",
"Kroger",
"Aldi",
"Lidl",
"Walgreens",
"CVS",
@MoeRayo
MoeRayo / upload-files-to-xata.vue
Last active September 30, 2023 02:20
wrapper for uploading files to Xata
<template>
<div class="flex flex-column flex-row-ns pa3 calisto bg-black-05">
<div class="w-100 ph3">
<form enctype="multipart/form-data" v-if="isInitial || isSaving">
<h2>Upload File</h2>
<div
class="b--dashed bw1 b--light-purple pa3 hover-bg-black-10 bg-animate pointer relative h4">
<input
type="file"
accept="image/*,application/pdf"
@MoeRayo
MoeRayo / tranform-images.vue
Created September 25, 2023 19:39
Transforming images mechanism
<template>
<div class="flex flex-column flex-row-ns pa3 calisto bg-black-05">
<div class="w-50-ns w-100 ph3">
<!-- upload image -->
</div>
<section class="w-40-l w-50-m w-100 ph3 tl" v-if="imageURL">
<h2>Transform Image</h2>
<form class="ba b--black bw2 bg-white br2 mw6 center pv2 ph4 shadow-5 f6">
<div>
@MoeRayo
MoeRayo / uploading-mechanism.vue
Created September 25, 2023 19:38
Mechanism for uploading files to Xata
<template>
<div class="flex flex-column flex-row-ns pa3 calisto bg-black-05">
<div class="w-50-ns w-100 ph3">
<!-- upload image -->
<form enctype="multipart/form-data" v-if="isInitial || isSaving">
<h2>Add Image</h2>
<div
class="b--dashed bw1 b--light-purple pa3 hover-bg-black-10 bg-animate pointer relative h4">
<input
@MoeRayo
MoeRayo / Transformation-ui.vue
Created September 25, 2023 19:35
Mechanism that allows users to add the transformation option values
<template>
<div class="flex flex-column flex-row-ns pa3 calisto bg-black-05">
<div class="w-50-ns w-100 ph3">
<!-- upload image -->
...
</div>
<section class="w-40-l w-50-m w-100 ph3 tl">
<h2>Transform Image</h2>
<form class="ba b--black bw2 bg-white br2 mw6 center pv2 ph4 shadow-5 f6">
<template>
<div class="flex absolute vh-auto top-4 left-2 right-2 w-90 center mw9">
<div class="mr3 bg-white w-70 br3 pa3">
<form @submit.prevent="generateInvoice" class="flex justify-between flex-wrap">
<div v-for="basicinfo in basicData" :key="basicinfo.id" class="w-50-l w-100">
<TheDashboardInput v-model="basicinfo.inputdata" :formData="basicinfo.formdata" :type="basicinfo.type" :otherData="basicinfo.otherdata"/>
</div>
<h3 class="dark-blue w-100 f3 underline">ITEMS</h3>
<div v-for="item in itemsData" :key="item.id" class="w-50-l w-100">
<template>
<div>
<cld-image publicId="cv_gen.pdf" ref="ref" >
<cld-transformation flags="rasterize" />
<cld-transformation :overlay="{fontFamily: 'Open Sans', fontSize: 75, text: `${userData.firstname} ${userData.lastname}`}" color="#58697B" gravity="west" x="100" y="-670"/>
<cld-transformation :overlay="{fontFamily: 'Open Sans', fontSize: 18, text: userData.phoneNumber}" color="#58697B" gravity="west" x="180" y="-577"/>
<cld-transformation :overlay="{fontFamily: 'Open Sans', fontSize: 18, text: userData.email}" color="#58697B" gravity="west" x="550" y="-577"/>
<template>
<div class="flex absolute vh-auto top-4 left-2 right-2 w-90 center mw9">
<div class="mr3 bg-white w-70 br3 pa3">
<form @submit.prevent="createResume" class="flex justify-between flex-wrap">
<div class="w-50-l w-100">
<label for="email" class="db mb3 black-70 ttu fw7">Firstname</label>
<input
id="firstname"
v-model="userData.firstname"
name="firstname"