Skip to content

Instantly share code, notes, and snippets.

View isholaomotayo's full-sized avatar

Omotayo Ishola isholaomotayo

View GitHub Profile
async function verifyToken(authHeader: string): Promise<JwtPayload> {
const token = getToken(authHeader)
const jwt = decode(token, { complete: true }) as Jwt
logger.info(`jwt after decoding: ${jwt}`)
const keyId = jwt.header.kid
logger.info(`keyId: ${jwt}`)
const pemCertificate = await getCertificateByKeyId(keyId)
@isholaomotayo
isholaomotayo / index.go
Created October 26, 2021 05:57 — forked from kimihito/index.go
Running labstack/echo on Zeit now (Vercel) Serverless function
// set api/index.go
package handler
import (
"net/http"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
@isholaomotayo
isholaomotayo / typescript-crash.ts
Created August 27, 2021 12:54 — forked from bradtraversy/typescript-crash.ts
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@isholaomotayo
isholaomotayo / creative-cloud-disable.md
Created July 4, 2020 11:13 — forked from andreibosco/creative-cloud-disable.md
disable creative cloud startup on mac
@isholaomotayo
isholaomotayo / Code.gs
Created December 31, 2019 00:16 — forked from edwinlee/Code.gs
Sync a Google Sheets spreadsheet to a Firebase Realtime database
/**
* Copyright 2019 Google LLC.
* SPDX-License-Identifier: Apache-2.0
*/
function getEnvironment() {
var environment = {
spreadsheetID: "<REPLACE WITH YOUR SPREADSHEET ID>",
firebaseUrl: "<REPLACE WITH YOUR REALTIME DB URL>"
};
@isholaomotayo
isholaomotayo / Simpler States and LGA in Nigeria Object JS
Created October 31, 2019 10:58
Simpler States and LGA in Nigeria Object
let states= {
"Abia State": ["Aba South", "Arochukwu", "Bende", "Ikwuano", "Isiala Ngwa North", "Isiala Ngwa South", "Isuikwuato", "Obi Ngwa", "Ohafia", "Osisioma", "Ugwunagbo", "Ukwa East", "Ukwa West", "Umuahia North", "Umuahia South", "Umu Nneochi"]
,
"Adamawa State": ["Fufure", "Ganye", "Gayuk", "Gombi", "Grie", "Hong", "Jada", "Lamurde", "Madagali", "Maiha", "Mayo Belwa", "Michika", "Mubi North", "Mubi South", "Numan", "Shelleng", "Song", "Toungo", "Yola North", "Yola South"]
,
"Akwa Ibom State": ["Eastern Obolo", "Eket", "Esit Eket", "Essien Udim", "Etim Ekpo", "Etinan", "Ibeno", "Ibesikpo Asutan", "Ibiono-Ibom", "Ika", "Ikono", "Ikot Abasi", "Ikot Ekpene", "Ini", "Itu", "Mbo", "Mkpat-Enin", "Nsit-Atai", "Nsit-Ibom", "Nsit-Ubium", "Obot Akara", "Okobo", "Onna", "Oron", "Oruk Anam", "Udung-Uko", "Ukanafun", "Uruan", "Urue-Offong/Oruko", "Uyo"]
,
"Anambra State": ["Anambra East", "Anambra West", "Anaocha", "Awka North", "Awka South", "Ayamelum", "Dunukofia", "Ekwusig
@isholaomotayo
isholaomotayo / Better State and Local governments of Nigeria Object JS
Created October 31, 2019 10:35
Better State and Local governments of Nigeria Object JS
let states= {
"Abia State": {
"name": "Abia State",
"id": 1,
"locals": [
{
"name": "Aba South",
"id": 1
},
// 20190922090229
// http://localhost:3000/documentation/json
{
"swagger": "2.0",
"info": {
"title": "Fastify API",
"description": "Building a blazing fast REST API with Node.js, MongoDB, Fastify and Swagger",
"version": "1.0.0"
},
@isholaomotayo
isholaomotayo / php-pools.md
Created June 19, 2019 09:17 — forked from holmberd/php-pools.md
Adjusting child processes for PHP-FPM (Nginx)

Adjusting child processes for PHP-FPM (Nginx)

When setting these options consider the following:

  • How long is your average request?
  • What is the maximum number of simultaneous visitors the site(s) get?
  • How much memory on average does each child process consume?

Determine if the max_children limit has been reached.

  • sudo grep max_children /var/log/php?.?-fpm.log.1 /var/log/php?.?-fpm.log
Example infrastructure outage incident report
Friday, May 13, 2077
By the Example Security Team
Earlier this week we experienced an outage in our API infrastructure. Today we’re providing an incident report that details the nature of the outage and our response.
The following is the incident report for the Example Security outage that occurred on April 30, 2077. We understand this service issue has impacted our valued developers and users, and we apologize to everyone who was affected.