Skip to content

Instantly share code, notes, and snippets.

View orimdominic's full-sized avatar
👋
I'm hacking awaaaay...

Orim Dominic Adah orimdominic

👋
I'm hacking awaaaay...
View GitHub Profile
@orimdominic
orimdominic / object-props-to-array.js
Created July 6, 2023 08:23
Recursively iterate over an object to return an array of all the paths in the object
function extractPropsToArray(obj, arr = [], path = "") {
for (const key in obj) {
if (Object.hasOwnProperty.call(obj, key)) {
const element = obj[key];
const isObject = typeof element === "object";
if (isObject) {
const pathname = Boolean(path) ? `${path}.${key}` : `${key}`
extractPropsToArray(element, arr,pathname )
} else {
const pathname = Boolean(path) ? `${path}.${key}` : `${key}`
@orimdominic
orimdominic / Done-CheckPoints.md
Created April 2, 2022 03:12 — forked from mykeels/Done-CheckPoints.md
A list of checkpoints, to be marked before an application can be said to be "done".

Web Apps

  • Migrations (if applicable)
  • Seeders (if applicable)
  • Automated Tests
    • Integration
    • E2E
      • Authentication
      • Authorization
  • Documentation
@orimdominic
orimdominic / set-interval.js
Last active June 4, 2021 12:14
Implement setInterval method using setTimeout
/*
Implement the setInterval function in such a way that calling SetInterval.prototype.start
will start the function passed to it and run the function at intervals `interval` until
the SetInterval.prototype.clear method is called.
For example:
const theIntervalRunner = SetInterval(()=> console.log("logging'), 1000)
theIntervalRunner.start()
setTimeout(() => theIntervalRunner.clear(), 5000)
@orimdominic
orimdominic / vscode.snippets.json
Last active September 14, 2023 08:11
VSCode snippets
{
// Place your snippets for javascript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
// "Print to console": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
class Vehicle{
factory Vehicle(int numberOfTyres) {
// An if-else statement can be used too
switch (numberOfTyres) {
case 2:
return Motorcycle();
case 3:
return Tricycle();
case 4: