Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / programas.md
Created July 13, 2023 20:10
Programas para hacer diagramas entidad relación
@Klerith
Klerith / time-since.ts
Created November 2, 2022 20:36
Fecha de creación humana
export const timeSince = ( date: string ) => {
const baseDate = new Date(date)
const seconds = Math.floor(( new Date().getTime() - baseDate.getTime() ) / 1000);
let interval = seconds / 31536000;
@Klerith
Klerith / useForm.js
Created June 6, 2022 19:58
useForm con Validaciones
import { useEffect, useMemo, useState } from 'react';
export const useForm = ( initialForm = {}, formValidations = {}) => {
const [ formState, setFormState ] = useState( initialForm );
const [ formValidation, setFormValidation ] = useState({});
useEffect(() => {
createValidators();
}, [ formState ])
@Klerith
Klerith / modal.css
Created June 8, 2020 17:40
React Modal Styles
/* Modal */
.ReactModalPortal > div{
opacity: 0;
}
.ReactModalPortal .ReactModal__Overlay {
align-items: center;
display: flex;
justify-content: center;
transition: opacity .2s ease-in-out;