Skip to content

Instantly share code, notes, and snippets.

View digitaldrreamer's full-sized avatar
💭
I may be slow to respond. Gimme three days, at most ;)

Abdullah Olawale Bashir digitaldrreamer

💭
I may be slow to respond. Gimme three days, at most ;)
View GitHub Profile
@digitaldrreamer
digitaldrreamer / objectDiff.js
Last active October 23, 2024 08:34
A Function to Compare Two Objects and Get The Difference or return `null`.
/**
* Compares two objects and returns the differences, or null if they're the same
* @param {Object} original - Original form data
* @param {Object} current - Current form data
* @returns {Object|null} Object containing only the changed fields, or null if no changes
*/
function getObjectDiff(original, current) {
const changes = {};
for (const [key, value] of Object.entries(current)) {
@digitaldrreamer
digitaldrreamer / Editorjs.svelte
Last active December 25, 2024 15:17
EditorJS with Svelte 5
<script>
import {onMount} from "svelte";
/**
* @type {EditorJS | null}
*/
let editor = $state(null);
/** @type {HTMLElement | null} */
const express = require("express");
const Sentry = require("@sentry/node");
const prisma = require("./prisma"); // Adjust to the correct path for your Prisma instance
const { verifyFlutterwavePayment, fetchSubscriptions } = require("./functions/payment"); // Payment utility functions
const { FLUTTERWAVE_WEBHOOK_SECRET_DEV, FLUTTERWAVE_WEBHOOK_SECRET_PROD } = process.env; // Environment variables for webhook secrets
const { triggerUpdateNoBtn } = require("./functions/emails"); // Email notification utility
const logger = require("./utils/logger"); // Custom logger for structured logging
const { format } = require("timeago.js"); // Library for formatting dates relative to current time
const router = express.Router();
@digitaldrreamer
digitaldrreamer / Dockerfile
Last active April 20, 2025 15:23
Dockerfile for Crawlee (Playwright+Chromium) on ARM64
ARG NODE_VERSION=20
FROM --platform=linux/arm64 node:${NODE_VERSION}-bookworm-slim
LABEL maintainer="[email protected]" description="Base image for Apify Actors using Chromium (ARM64)"
ENV DEBIAN_FRONTEND=noninteractive
# Install OS-level deps, Chromium, fonts, XVFB
RUN apt-get update \
&& apt install -y \
ca-certificates \