Skip to content

Instantly share code, notes, and snippets.

View Hoxtygen's full-sized avatar
🎯
Focusing

Wasiu Idowu Hoxtygen

🎯
Focusing
  • Nigeria
View GitHub Profile
@Hoxtygen
Hoxtygen / git-commit-template.md
Created February 22, 2023 20:37 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@Hoxtygen
Hoxtygen / gist:fa6f761b31e456569660ac970d607489
Created January 28, 2023 06:07 — forked from whisher/gist:c8e0453a5fa76b5d6d952919c77ef0c4
reactjs typescript useForm - a simple custom hook to manage form in react
Credit to
https://medium.com/javascript-in-plain-english/react-controlled-forms-with-hooks-538762aab935
import React, { ChangeEvent, FormEvent, useReducer } from "react";
const useForm = (initialState: any) => {
const reducer = (
state: typeof initialState,
payload: { field: string; value: string }
) => {
@Hoxtygen
Hoxtygen / mixed-number-converter.js
Created December 27, 2019 09:28 — forked from KimSarabia/mixed-number-converter.js
Simple fraction to mixed number converter
// https://www.codewars.com/kata/simple-fraction-to-mixed-number-converter/
var greatest = (a,b) => (b===0) ? a : greatest(b,a%b)
function mixedFraction(s){
arr = s.split('/')
dividend = Number(arr[0])
divisor = Number(arr[1])
if(divisor === 0){
throw "ZeroDivisionError";
} else {
if(dividend%divisor === 0){