Skip to content

Instantly share code, notes, and snippets.

View IBRAHIMDANS's full-sized avatar
:shipit:
Focusing

Ibrahima Dansoko IBRAHIMDANS

:shipit:
Focusing
View GitHub Profile
@IBRAHIMDANS
IBRAHIMDANS / isNewVersion.js
Last active October 16, 2023 15:34
Compare two version strings to determine if one version is newer than the other
/**
* Compare two version strings to determine if one version is newer than the other.
*
* @param {string} currentVersion - The current version string to compare.
* @param {string} version - The version string to compare with the current version.
* @returns {boolean} True if the 'version' is newer than 'currentVersion', false otherwise.
* @throws {Error} If either 'currentVersion' or 'version' is not a valid version string.
*
* @example
@IBRAHIMDANS
IBRAHIMDANS / usePagination.tsx
Created October 11, 2021 04:48
hooks usePagination
import { useState } from "react";
const usePagination: UsePagination = ({ contentPerPage, count }) => {
const [page, setPage] = useState(1);
// number of pages in total (total items / content on each page)
const pageCount = Math.ceil(count / contentPerPage);
// index of last item of current page
const lastContentIndex = page * contentPerPage;
// index of first item of current page
const firstContentIndex = lastContentIndex - contentPerPage;
@IBRAHIMDANS
IBRAHIMDANS / slugify.txt
Last active September 2, 2021 21:10
slugify
const slugify = (world, separator = '-') => {
return world.toString()
.normalize('NFD')
.replace(/[\u0300-\u036f]/g, '')
.toLowerCase()
.trim()
.replace(/[^a-z0-9 ]/g, '')
.replace(/\s+/g, separator)
}
#!/usr/bin/env bash
# "/Applications/Visual Studio Code.app//Contents/Resources/app/bin/code" --list-extensions for list extention
code --install-extension aaron-bond.better-comments
code --install-extension abusaidm.html-snippets
code --install-extension akamud.vscode-theme-onedark
code --install-extension alefragnani.project-manager
code --install-extension anseki.vscode-color
code --install-extension aslamanver.vsc-export
code --install-extension attilabuti.vscode-mjml
@IBRAHIMDANS
IBRAHIMDANS / temporary-email-address-domains
Created November 1, 2020 11:40 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com

Code review guidelines

Based on a list Michael Azerhad published on linkedin.

  1. La portée des variables/méthodes/classes
  2. Les traces de muabilité là où l'immuabilité est plus adéquate
  3. L'indentation
  4. Le nommage des méthodes, classes et variables
  5. L'orthographe et la grammaire => très important
  6. Les duplications de code
MAC:
open /Applications/Google\ Chrome.app/ --args --disable-web-security --user-data-dir
WINDOWS
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:/ChromeDevSession"