Skip to content

Instantly share code, notes, and snippets.

View ms10596's full-sized avatar
🎯
Focusing

Mohamed Sayed ms10596

🎯
Focusing
View GitHub Profile
@ms10596
ms10596 / useBackForward.ts
Last active May 9, 2023 12:55
useBackForward is a react hook for navigating back and forward. The hook returns two functions for navigation and two boolean variables that detect if there's an available back and forward in order to have a better user experience.
import { useEffect, useState } from 'react';
import { useLocation, useNavigate, useNavigationType } from 'react-router';
export default () => {
const navigationType = useNavigationType();
const location = useLocation();
const navigate = useNavigate();
const [currentIndex, setCurrentIndex] = useState(0);
const [routesLength, setRoutesLength] = useState(0);
@ms10596
ms10596 / ducks2019type3.csv
Last active January 13, 2021 09:58 — forked from negedng/ducks2019type3.csv
Use of different meanings of duck. Sentences from here: https://sentence.yourdictionary.com/duck Meanings: https://www.merriam-webster.com/dictionary/duck
Sentence Type
Game birds consist of teal and wild duck, snipe, jungle fowl and peacock. 0
He slid up right behind her before she could duck into a shop. 1
Geese, duck and teal are abundant. 0
The duck, on the other hand, when newly hatched, and for nearly a month after, has ternum wholly cartilaginous. 0
I have laughed at the poor duck, with the red rag tied round its leg. 0
A cannon ball, flying close to him, caused him to duck and bend over his horse. 1
I just need a place to duck out of the rain for a bit. 1
Hen and duck house. 0
The ceiling was so low I had to duck my head. 1