Skip to content

Instantly share code, notes, and snippets.

View OlivierJM's full-sized avatar

ojm OlivierJM

View GitHub Profile
@OlivierJM
OlivierJM / Don't use Vim.md
Created April 29, 2025 07:22 — forked from romainl/Don't use Vim.md
Don't use Vim for the wrong reasons

Don't use Vim

Don't do the crime, if you can't do the time.

-- Anthony Vincenzo "Tony" Baretta

Vim is an amazing text editor. I love it. Really, I wouldn't [organize][organize] a Vim advent calendar if I didn't. But, as amazing as it is, Vim is not for everyone. It can't solve all your problems, or be a TUI version of your favorite IDE, or make you a better programmer, or land you that dream job in the Bay Area. But Vim can help you be more mindful, focused, and efficient, as long as you approach it with the right mindset.

Don't get me wrong, I certainly welcome you to try Vim, but I'm not a proselyte. I don't thrive on newbies. I just want you to use the right tool for the job and not waste your—and anyone's—time on a fruitless quest.

{
"info": {
"name": "Flask Bank API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Register",
"request": {
"method": "POST",
@OlivierJM
OlivierJM / promises.js
Created August 8, 2024 06:23
Show how to use promises
const fetchData = () => {
return new Promise((resolve, reject) => {
// Here we are simulating an action that would likely take time, basically it doesn't run immediately
// it could be something like long calculations, fetching data from a server, writing data to a file, etc ...
setTimeout(() => {
const success = true; // this is just to simulate a successful action
if (success) {
// if we succeed then we mark as resolved
resolve('Data fetched successfully!');
@OlivierJM
OlivierJM / interview.md
Created July 14, 2024 10:47
interview.md
  1. What is the output of the following code?
console.log(typeof NaN);

a) "undefined" b) "number" c) "NaN" d) "object"

[
{
"number": 1,
"key": "ibyo-tubona-mwiyi-si",
"title": "Ibyo tubona mw'iyi si",
"markdown": "1. Ibyo tubona ...Mwiyisi Nubusagusa\nNinyi Buchu bihinduka mukanya gato Neino duhunge umujyinya wuwiteka\n\n**Chorus**\n\nImanda Yanyuma nivuga nituzasezeranaho abapfuye bazazuka tuzarebana twishimye tuzarira amarirayumunezero.\n\n2. ubugome bwikigihe burenze urugero Abantu benshi bigize \n\n**Chorus**\nIsinshya nijuru Rishya Yesu azadutambagiza yerusaremunshya tuza mbikwa amakamba yizahabu.\n\n3. Ababyeyi Bikigihe barahangayitse abana babobigize ibwigomeke Yesu Niwemurezi mwiza utayobya.\n\n**Chorus**\n\nImanda Yanyuma nivuga nituzasezeranaho abapfuye bazazuka tuzarebana twishimye tuzarira amarirayumunezero.(×2)\n\nIsinshya nijuru Rishya dorebose byahumuye Yesu azadutambagiza muri yerusaremunshya tuza mbikwa amakamba yizahabu.(×2}"
},
{
"number": 2,
"key": "tuzanywe-no-kuvuga",
@OlivierJM
OlivierJM / student_admin.py
Last active February 8, 2024 17:55
student management
import json
students = []
def add_student():
print("\nAdd New Student Details:")
last_name = input("Last Name: ")
first_name = input("First Name: ")
id_number = input("ID Number: ")
major = input("Major: ")
@echo off
setlocal enabledelayedexpansion
:: Prompt for username
set /p username=Enter the username for which you want to change the password:
:: Prompt for new password
set /p newPassword=Enter the new password:
:: Change the password
@OlivierJM
OlivierJM / records_keeper.py
Last active December 25, 2023 09:40
records_keeper.py
import json
students_data = []
def add_student():
last_name = input("Enter last name: ")
first_name = input("Enter first name: ")
id_number = input("Enter ID number: ")
major = input("Enter major: ")
email = input("Enter email: ")
{
"breakpoints": {
"keys": [
"xs",
"sm",
"md",
"lg",
"xl"
],
"values": {
import { useEffect, useState } from 'react';
/**
* Debounce a value to avoid constant calls to the server
* @param value it can be a string or a number
* @param delay the amount in milliseconds that will be delayed
* @returns The give value debounced
*/
export default function useDebounceValue<T>(value: T, delay: number): T {
const [debouncedValue, setDebouncedValue] = useState<T>(value);