Skip to content

Instantly share code, notes, and snippets.

View comlyboy's full-sized avatar

Cornelius Okeke comlyboy

View GitHub Profile
documentation platform
https://docsify.js.org
@comlyboy
comlyboy / interface.ts
Last active February 12, 2025 07:04
Coventi database schema
// User Schema ...
export const UserSchema = new Schema<IUser>({
firstName: { type: String, required: true, trim: true, minlength: 2, lowercase: true },
surName: { type: String, required: true, trim: true, minlength: 2, lowercase: true },
contact: {
email: { type: String, required: true, trim: true, unique: true, lowercase: true },
phoneNumber: { type: String },
},
"synth:layer": "cdk synth -c which=layer --toolkit-stack-name workinance-toolkit --verbose",
"synth:staging": "cdk synth -c which=api-staging --toolkit-stack-name workinance-toolkit --verbose",
"synth:prod": "cdk synth -c which=api-production --toolkit-stack-name workinance-toolkit --verbose",
"deploy:staging": "cdk deploy -c which=api-staging --toolkit-stack-name workinance-toolkit --require-approval never",
"deploy:prod": "cdk deploy -c which=api-production --toolkit-stack-name workinance-toolkit --require-approval never",
"bootstrap:staging": "cdk bootstrap -c which=api-staging --toolkit-stack-name workinance-toolkit --require-approval never",
"bootstrap:prod": "cdk bootstrap -c which=api-production --toolkit-stack-name workinance-toolkit --require-approval never",
"bootstrap:layer": "cdk bootstrap -c which=layer --toolkit-stack-name workinance-toolkit --require-approval never",
"deploy:layer": "cdk deploy -c which=layer --toolkit-stack-name workinance-toolkit --require-approval never"
@comlyboy
comlyboy / webpack.config.js
Last active December 30, 2024 16:45
Simple webpack configurations for nestjs project
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const TerserPlugin = require("terser-webpack-plugin");
const { TsconfigPathsPlugin } = require('tsconfig-paths-webpack-plugin');
/**
* @param {string} url
*/
function getFullPath(url) {
return path.resolve(__dirname, url);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sample sidenav</title>
<link rel="stylesheet" href="style.css">
<link href='https://unpkg.com/boxicons@2.1.4/css/boxicons.min.css' rel='stylesheet'>
</head>
import amqplib from 'amqplib';
import once from 'lodash.once';
import { AMPQ_CONNECTION_URL } from './configuration/configuration';
let amqplibInstance: MessageBroker | null = null;
export class MessageBroker {
queues: Record<string, Function[]>;
connection: amqplib.Connection | null = null;
//@ts-check
'use strict';
const { merge } = require('webpack-merge');
const nodeExternals = require('webpack-node-externals');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const base = {};
const config = merge(base, {
SanitizeObject<T extends object>({
data,
keysToRemove = [] }: {
data: T;
keysToRemove?: string[];
}): Promise<T> {
return new Promise<T>((resolve, reject) => {
if (!(data && typeof data === "object")) { resolve(data); }
if (Array.isArray(data)) { resolve(data); }
keysToRemove.forEach(element => {
@comlyboy
comlyboy / takeMultipleScreenshots.js
Created February 6, 2023 03:57 — forked from crevulus/takeMultipleScreenshots.js
A small script using puppeteer to get screenshots of multiple browser pages.
const puppeteer = require("puppeteer");
const pages = require("./webPages.json");
async function takeMultipleScreenshots() {
try {
const browser = await puppeteer.launch();
const page = await browser.newPage();
for (const { id, name, url } of pages) {
@comlyboy
comlyboy / customer-details.template.html
Created February 3, 2023 18:45
pos reciept template with qrcode
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- <meta http-equiv="Content-Type" content="text/html charset=utf-8"> -->
<style type="text/css">
</style>
</head>