Skip to content

Instantly share code, notes, and snippets.

View ismummy's full-sized avatar

ISMAIL, Olalekan R. ismummy

View GitHub Profile
'use strict';
class Expense {
constructor(type, amount) {
this.type = type;
this.amount = amount;
}
}
class ExpenseReport {
@ismummy
ismummy / aes-encryption-decryption
Created October 12, 2021 10:59
AES-ENCRYPTION-DESCRIPTION IN NODEJS
const crypto = require('crypto');
const ENCRYPTION_KEY = ''//16/32 characters
const IV_KEY = '' //16 charactere
function getAlgorithm(key) {
switch (key.length) {
case 16:
return 'aes-128-cbc';
case 32:
@ismummy
ismummy / recuring charge
Created July 2, 2021 12:09
Flutterwave Recurring Charge
//first check if card data exist in the transaction verification response then save the card token in db
static saveCardToken = async (verificationData, Customer) => {
if (verificationData) {
const paymentType = verificationData.paymenttype
if (paymentType === "card" || paymentType === "CARD") {
if (verificationData.card) {
const paymentCard = verificationData.card
const token = paymentCard.life_time_token
? paymentCard.life_time_token
@ismummy
ismummy / docker-compose.yml
Created June 6, 2021 11:37 — forked from karakanb/docker-compose.yml
A simple docker-compose example
version: '3'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
environment:
FLASK_ENV: development
@ismummy
ismummy / FCMHandler.js
Last active November 25, 2020 11:55
Firbase push notification helper class
require('dotenv').config();
const FCM = require('fcm-node');
const serverKey = process.env.GOOGLE_API_KEY;
const fcm = new FCM(serverKey);
class FCMHandler {
static sentToTopic(topic, flag, message) {
const msg = {
to: `/topics/${topic}`,
@ismummy
ismummy / sequelize-schema-file-generator.js
Created May 14, 2020 20:21 — forked from manuelbieh/sequelize-schema-file-generator.js
Automatically generates migration files from your sequelize models
import * as models from "models";
import Sequelize from "sequelize";
import fs from "fs";
delete models.default;
const sequelize = new Sequelize(
'',
'',
'', {
@ismummy
ismummy / Android Studio .gitignore
Created June 12, 2019 19:45 — forked from iainconnor/Android Studio .gitignore
A .gitignore for use in Android Studio
# Built application files
/*/build/
# Crashlytics configuations
com_crashlytics_export_strings.xml
# Local configuration file (sdk path, etc)
local.properties
# Gradle generated files
@ismummy
ismummy / RoomExample.java
Created May 11, 2019 23:27 — forked from adigunhammedolalekan/RoomExample.java
Room, LiveData example
// this file is just a pseudo code of the whole idea
// we have 3 entities - Booking, User and Address(Origin and Destination)
// example userDao
class UserDao {
public User getUser(int id);
}