Skip to content

Instantly share code, notes, and snippets.

View hellotunmbi's full-sized avatar

Olutunmbi Banto hellotunmbi

View GitHub Profile
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-feed
labels:
app: backend-feed
spec:
replicas: 2
selector:
matchLabels:
@hellotunmbi
hellotunmbi / parser.js
Created September 17, 2022 18:20 — forked from lordgape/parser.js
A node utility class to convert xml to json and vice versa. Depends on xml2js and jsontoxml node package
const jsonxml = require("jsontoxml");
const parseString = require("xml2js").parseString;
const { promisify } = require("util");
const promisfiedParseString = promisify(parseString);
module.exports = class Parser {
static parseJSONBodyToXML(jsonArgument) {
return jsonxml(jsonArgument, { html: true });
}
@hellotunmbi
hellotunmbi / 1.mongodb-aws-setup-guide.md
Created July 11, 2022 03:31 — forked from calvinh8/1.mongodb-aws-setup-guide.md
MongoDB Setup Guide for AWS EC2 Instances with Auth Enabled

MongoDB AWS EC2 Setup Guide

You can see my latest update in my blog here https://medium.com/@calvin.hsieh/steps-to-install-mongodb-on-aws-ec2-instance-62db66981218

Credits:

Big thanks to Elad Nava and Shane Rainville for writing the above articles that allow me to conduct this guide. If by all means that I violated original post's copyright, please contact me.

@hellotunmbi
hellotunmbi / nigeria-states-lga.txt
Created December 23, 2021 21:05 — forked from segebee/gist:7dde9de8e70a207e6e19
Nigeria States and Local Government Areas JSON - codingsavvy.com
[{"state":{"name":"Abia State","id":1,"locals":[{"name":"Aba South","id":1},{"name":"Arochukwu","id":2},{"name":"Bende","id":3},{"name":"Ikwuano","id":4},{"name":"Isiala Ngwa North","id":5},{"name":"Isiala Ngwa South","id":6},{"name":"Isuikwuato","id":7},{"name":"Obi Ngwa","id":8},{"name":"Ohafia","id":9},{"name":"Osisioma","id":10},{"name":"Ugwunagbo","id":11},{"name":"Ukwa East","id":12},{"name":"Ukwa West","id":13},{"name":"Umuahia North","id":14},{"name":"Umuahia South","id":15},{"name":"Umu Nneochi","id":16}]}},{"state":{"name":"Adamawa State","id":2,"locals":[{"name":"Fufure","id":1},{"name":"Ganye","id":2},{"name":"Gayuk","id":3},{"name":"Gombi","id":4},{"name":"Grie","id":5},{"name":"Hong","id":6},{"name":"Jada","id":7},{"name":"Lamurde","id":8},{"name":"Madagali","id":9},{"name":"Maiha","id":10},{"name":"Mayo Belwa","id":11},{"name":"Michika","id":12},{"name":"Mubi North","id":13},{"name":"Mubi South","id":14},{"name":"Numan","id":15},{"name":"Shelleng","id":16},{"name":"Song","id":17},{"name":"Toung
# activate URL rewriting
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
// movies.spec.js
...
// Testing the POST /movies endpoint
it("tests the post new movies endpoint and returns as success message", async () => {
const response = await supertest(app).post('/movies').send({
title: 'New Movie',
synopsis: 'Synopsis of the new movie',
rating: 'PG'
//movies.spec.js
const supertest = require('supertest');
const app = require('../server');
describe("Testing the movies API", () => {
it("tests the base route and returns true for status", async () => {
const response = await supertest(app).get('/');
//movies.spec.js
const supertest = require('supertest');
const app = require('../server');
describe("Testing the movies API", () => {
it("tests the base route and returns true for status", async () => {
const response = await supertest(app).get('/');
@hellotunmbi
hellotunmbi / database.rules.json
Created October 13, 2019 13:53 — forked from codediodeio/database.rules.json
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@hellotunmbi
hellotunmbi / codility_solutions.txt
Created August 24, 2019 05:38 — forked from lalkmim/codility_solutions.txt
Codility Solutions in JavaScript
Lesson 1 - Iterations
- BinaryGap - https://codility.com/demo/results/trainingU2FQPQ-7Y4/
Lesson 2 - Arrays
- OddOccurrencesInArray - https://codility.com/demo/results/trainingFN5RVT-XQ4/
- CyclicRotation - https://codility.com/demo/results/trainingSH2W5R-RP5/
Lesson 3 - Time Complexity
- FrogJmp - https://codility.com/demo/results/training6KKWUD-BXJ/
- PermMissingElem - https://codility.com/demo/results/training58W4YJ-VHA/