This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
class Expense { | |
constructor(type, amount) { | |
this.type = type; | |
this.amount = amount; | |
} | |
} | |
class ExpenseReport { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
web: | |
build: . | |
ports: | |
- "5000:5000" | |
volumes: | |
- .:/code | |
environment: | |
FLASK_ENV: development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}`, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as models from "models"; | |
import Sequelize from "sequelize"; | |
import fs from "fs"; | |
delete models.default; | |
const sequelize = new Sequelize( | |
'', | |
'', | |
'', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Built application files | |
/*/build/ | |
# Crashlytics configuations | |
com_crashlytics_export_strings.xml | |
# Local configuration file (sdk path, etc) | |
local.properties | |
# Gradle generated files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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); | |
} |