Skip to content

Instantly share code, notes, and snippets.

View ezemery's full-sized avatar
🎯
Learning Everyday

Ezechukwu ezemery

🎯
Learning Everyday
View GitHub Profile
@ezemery
ezemery / filter.js
Last active September 2, 2021 20:39
React filter logic from a project I worked on.
import React, { Fragment, useEffect, useState, useMemo } from 'react';
const filterBy = {
disciplines: (item, selectedDisciplines) => {
const selectDisciplinesArr = Object.keys(selectedDisciplines).filter(key =>
Boolean(selectedDisciplines[key])
)
return selectDisciplinesArr.length
? selectDisciplinesArr.indexOf(item.discipline) > -1
function readInput() {
const readline = require('readline')
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
let problem = {
T: 0,
testCases: []
@ezemery
ezemery / init.js
Last active March 25, 2021 20:31
This is a initialisation script for a javascript widget I built. The widget is embedded on popular e-commerce website such as https://www.princesspolly.com.au/pages/shop-tiktok. The widget enables merchants to import tiktok and instagram videos on their website making products shoppable.
<div id="vop-root"></div>
<script type="text/javascript">
(function (w, d, s, o, f, js, fjs) {
w[o] = w[o] || function () { (w[o].q = w[o].q || []).push(arguments) };
js = d.createElement(s), fjs = d.getElementsByTagName(s)[0];
js.id = o; js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs);
}(window, document, 'script', 'vop', ' https://cdn.getvop.com/embed/scripts/embed.js'));
vop('init', { element: document.getElementById('vop-root'), appId: 558, component: 'carousel', template: 2, socials: { tiktok: 'https://www.tiktok.com/@princesspolly' } });
</script>
@ezemery
ezemery / install-docker.md
Created June 8, 2019 14:08 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command
@ezemery
ezemery / class.api.php
Created October 28, 2018 16:08
Array of data to pass to Rave transfer API
$array = array(
'account_bank' => $bankcode,
'account_number' => $accountno,
'amount' => $amount,
'seckey' => $secretKey,
'narration' => $narration,
'currency' => "NGN",
'reference' => "rave-".time()
);
@ezemery
ezemery / class.api.php
Last active October 28, 2018 16:05
Making a transfer with Rave SDK
$single = new Transfer();
$result = $single->singleTransfer($array);
$trx = json_decode($result, true);
return $trx;
@ezemery
ezemery / class.api.php
Created October 28, 2018 15:53
Include the necessassary api files
require_once('Flutterwave/api/Transfer.php');
use Flutterwave\Transfer;
@ezemery
ezemery / .env
Created October 28, 2018 15:49
Add your secret key and public key
PUBLIC_KEY = "****YOUR**PUBLIC**KEY****"
SECRET_KEY = "****YOUR**SECRET**KEY****"
ENV = "staging or live"