Skip to content

Instantly share code, notes, and snippets.

View SomtoUgeh's full-sized avatar
:octocat:
Zzzzzch

Somto Medua-Ugeh SomtoUgeh

:octocat:
Zzzzzch
View GitHub Profile
@SomtoUgeh
SomtoUgeh / useUndo.ts
Created February 19, 2024 19:09 — forked from KristofferEriksson/useUndo.ts
A React hook that enhances your components with powerful undo/redo functionality
import { useCallback, useEffect, useRef, useState } from "react";
interface UseUndoHook<T> {
value: T;
onChange: (newValue: T) => void;
undo: () => void;
redo: () => void;
clear: () => void;
canUndo: boolean;
canRedo: boolean;
@SomtoUgeh
SomtoUgeh / numeric-input.html
Created December 10, 2022 14:58
good numeric input - accessible and clean
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Numeric input</title>
</head>
<body>
<main>

Keybase proof

I hereby claim:

  • I am somtougeh on github.
  • I am somtougeh (https://keybase.io/somtougeh) on keybase.
  • I have a public key ASADTJ_7m0pOOrBLquY8OH6qAhPTkXo1-6MHMHw_ydp8ggo

To claim this, I am signing this object:

import React, { useRef, useEffect } from "react";
import InputMask from "react-input-mask";
import { Formik, Form } from "formik";
import valid from "card-validator";
import visa from "assets/visa.svg";
import masterCard from "assets/mastercard.svg";
const initialValues = {
cardNo: "",
month: "",
import * as React from 'react';
import styled from 'styled-components';
import { naira } from 'utils/NairaFormat';
import { Box, Flex, Grid } from '@chakra-ui/core';
import { EmojiWrapper } from '../Dashboard/styles';
import { Label, PieChart, Pie, Tooltip, Cell } from 'recharts';
const COLORS = [
'#42B2F7',
'#25D1A2',
@SomtoUgeh
SomtoUgeh / chartsWithRechart.js
Created October 27, 2020 18:52
Different charts with recharts
import {
BarChart as RechartBarChart,
Bar,
XAxis,
YAxis,
Area,
AreaChart,
CartesianGrid,
ResponsiveContainer,
Tooltip,
const transactions = [
{ time: "2017-10-04T20:24:30+00:00", amount: 200, label: "food", type: "credit" },
{ time: "2017-11-04T20:24:30+00:00", amount: 200, label: "food", type: "credit" },
{ time: "2017-11-04T20:24:30+00:00", amount: 200, label: "food", type: "credit" },
{ time: "2017-11-04T20:24:30+00:00", amount: 200, label: "food", type: "debit" },
{ time: "2017-12-04T20:24:30+00:00", amount: 200, label: "food", type: "debit" },
{ time: "2017-12-04T20:24:30+00:00", amount: 200, label: "food", type: "debit" },
{ time: "2017-10-04T20:24:30+00:00", amount: 200, label: "food", type: "debit" },
];
@SomtoUgeh
SomtoUgeh / setup.sh
Created July 6, 2020 18:11 — forked from chris-sev/setup.sh
Mac Setup
# how to run this thingy
# create a file on your mac called setup.sh
# run it from terminal with: sh setup.sh
#!/bin/bash
set -euo pipefail
# Display message 'Setting up your Mac...'
echo "Setting up your Mac..."
sudo -v
function Star({ marked, starId }) {
return (
<span star-id={starId} style={{ color: "#ff9933" }} role="button">
{marked ? "\u2605" : "\u2606"}
</span>
);
}
function StarRating(props) {
const [rating, setRating] = React.useState(
/* Add new identifiers here */
enum AppModuleView {
DASHBOARD = "DASHBOARD",
PROFILE = "PROFILE",
FAQ = "FAQ",
SETTINGS = "SETTINGS"
}