Skip to content

Instantly share code, notes, and snippets.

View TheoOkafor's full-sized avatar
🎯
Focusing

Theo Okafor TheoOkafor

🎯
Focusing
  • Lagos, Nigeria
View GitHub Profile
@TheoOkafor
TheoOkafor / arrayDivider.js
Last active November 26, 2019 04:39
Splitting the items in an array into 3 different arrays, ensuring that all the arrays get an item before the next array gets another.
const fruits = ["apple", "orange", "tomato", "mango", "blackberry"];
const arr1 = [];
const arr2 = [];
const arr3 = [];
fruits.forEach((item, index) => {
const numArrays = 3 //the number of arrays required
const check = (index+1) % numArrays;
switch(check) {
@TheoOkafor
TheoOkafor / index-with-multer.js
Created November 18, 2019 14:56
nodejs-cloudinary-tutorial; setting up multer
const express = require('express');
const multer = require('multer');
const upload = multer();
const app = express();
app.use(express.json());
app.post('/cloud-upload', upload.single('file'), (request, response) => {});
@mofesolapaul
mofesolapaul / nigeria-states.json
Last active May 15, 2024 14:39
List of all Nigerian states, alphabetically arranged in JSON array
[
"Abia",
"Adamawa",
"Akwa Ibom",
"Anambra",
"Bauchi",
"Bayelsa",
"Benue",
"Borno",
"Cross River",
@johnmurch
johnmurch / fontawesome-icons.js
Created February 24, 2015 14:58
Font Awesome icon Names [Array] - v4.3.0
[
"fa-adjust",
"fa-adn",
"fa-align-center",
"fa-align-justify",
"fa-align-left",
"fa-align-right",
"fa-ambulance",
"fa-anchor",
"fa-android",