Skip to content

Instantly share code, notes, and snippets.

function decimalToRoman(num) {
  const romanNumerals = [
    { value: 1000, symbol: "M" },
    { value: 900, symbol: "CM" },
    { value: 500, symbol: "D" },
    { value: 400, symbol: "CD" },
    { value: 100, symbol: "C" },
    { value: 90, symbol: "XC" },
    { value: 50, symbol: "L" },

MongoDB backup overview

  1. mongoexport / mongoimport: These utilities are for dealing with JSON, CSV, or TSV formats, and are typically used for exporting and importing smaller amounts of data.

    • mongoexport: This utility can be used to export data from a MongoDB database to a JSON, CSV, or TSV file. You can specify a database, a collection, and optionally a query to export only certain documents. Here's an example of exporting a collection named myCollection from a database named myDatabase to a JSON file:

      mongoexport --db myDatabase --collection myCollection --out myCollection.json

Hex to RGB

function hexToRGB(hex) {
  hex = hex.replace("#", "");

  const red = parseInt(hex.substring(0, 2), 16);
  const green = parseInt(hex.substring(2, 4), 16);
  const blue = parseInt(hex.substring(4, 6), 16);

  return [red, green, blue];

}

8 Steps To Building A Successful Project

In order to create a successful project you need to do a lot more than just write code. In this video I break down the 8 crucial steps that you need to follow when you create any new project. These 8 steps will lead you on the path to success with you project.

  1. Determine the goal of the project
  2. Determine the target audience of the project
  3. Figure out the core feature/component of the project
  4. Think about the technology needed for the project
  5. Design the UI/UX of the project with design tools
  6. Build a quick and dirty MVP of the core feature/component of the project

Vue-router 4 basic setup

main.js

import { createApp } from "vue";
import { createRouter, createWebHistory } from "vue-router";
import { routes } from "./routes/routes.js";
import App from "./App.vue";

const router = createRouter({
  history: createWebHistory(),