Skip to content

Instantly share code, notes, and snippets.

View BolajiAyodeji's full-sized avatar
🥑
I'm looking for work. Let's talk!

Bolaji Ayodeji BolajiAyodeji

🥑
I'm looking for work. Let's talk!
View GitHub Profile
@BolajiAyodeji
BolajiAyodeji / cleanup.yml
Last active February 20, 2024 13:49
Automatically delete unused deployments and environments on GitHub.
name: Delete Environment
on:
push:
branches: [main, beta, alpha]
jobs:
delete:
runs-on: ubuntu-latest
steps:
@BolajiAyodeji
BolajiAyodeji / deploy-ml-web-workshop.md
Last active September 28, 2023 04:23
Pre-workshop instructions / software requirements for React Alicante 2023 "Deploying Machine Learning Models to the Web" workshop attendees.

🛠 Prerequisites and Installation Guide

Generally, you need the following:

  • A curious mind and desire to learn.
  • An understanding of or familiarity with the first five phases of the CRISP-DM data-mining framework.
  • A working laptop running on any operating system (Windows, Linux, or macOS).
  • Ability to navigate through the command-line interface (CLI).
  • Some existing machine learning model development knowledge (or an interest at least).
  • Some basic understanding of the Python programming language.
@BolajiAyodeji
BolajiAyodeji / test.json
Created July 26, 2023 22:18
A sample Contentful content type schema.
{
"name": "Country",
"description": "",
"displayField": "name",
"fields": [
{
"id": "name",
"name": "Name",
"type": "Symbol",
"localized": true,
@BolajiAyodeji
BolajiAyodeji / git-bundle.md
Created June 29, 2023 13:06
Bundle repository with all git history into another.
  1. Bundle the source repository:
git bundle create repo-name.bundle --all
  1. Move repo-name.bundle into the target directory.

  2. In the target directory, import the repo-name.bundle file.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<meta name="description" content="Simple weight converter">
<title>Weight Converter</title>
@BolajiAyodeji
BolajiAyodeji / rr-scheduling.py
Last active October 25, 2022 22:18
Python implementation of the Robin Round (RR) preemptive scheduling algorithm.
# Python3 program for implementation of RR scheduling
# Function to find the waiting time for all processes
def findWaitingTime(processes, n, bt, wt, quantum):
rem_bt = [0] * n
# Copy the burst time into rt[]
for i in range(n):
rem_bt[i] = bt[i]
t = 0 # Current time
let output = "";
const apiKey = "xxx";
async function sendEmail() {
await fetch("https://api.sendgrid.com/v3/mail/send", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
@BolajiAyodeji
BolajiAyodeji / prototypes-cheat-sheet.js
Created March 15, 2019 15:49
JavaScript Prototypes Cheat Sheet.
// Every object (except the root object) has a prototype (parent).
// To get the prototype of an object:
Object.getPrototypeOf(obj);
// In Chrome, you can inspect "__proto__" property. But you should
// not use that in the code.
// To get the attributes of a property:
Object.getOwnPropertyDescriptor(obj, 'propertyName');
command usage
git init Creates an empty Git repository in the specified directory.
git clone <repository name> Clones a repository located at <repository name> onto your local machine.
git add <directory> Stages only the specified changes for the next commit. Replace <directory> with a <file> to change a specific file.
git add . Stages new files and modifications without deletions
git add -A Stages all changes
git add -all Equivalent to git add -A
git add -u Stages modifications and deletions without adding new files
git add --update Equivalent to git add -u
git commit -m ”<message>” Commits the staged snapshot. replace <message> with the commit message.
const gm = require("gm").subClass({ imageMagick: true });
const fs = require("fs");
const images = fs.readdirSync("./images");
images.forEach((image) => {
gm(`./images/${image}`).write(
`./prc/${image.slice(0, 11)}.jpg`,
(err) => {
if (!err) console.log("✅ done");