Skip to content

Instantly share code, notes, and snippets.

View GeDiez's full-sized avatar
🏠
Working from home

Gibran LM GeDiez

🏠
Working from home
  • @michelada.io
View GitHub Profile
import { Button, Image } from 'ui';
import metamapSrc from '@assets/images/metamap.webp';
import { getMetaMapConfig } from '@config';
import { useMetamap } from './hooks';
const { scriptSrc } = getMetaMapConfig();
const styles = {
button: {
width: 'xs',
@GeDiez
GeDiez / react-hook-timer.js
Last active May 8, 2025 15:59
Simple Timer
const timer = ({ interval = 1000, onTime = () => {} }) => {
let time = 0;
let pid = null;
const stop = () => {
clearInterval(pid);
};
const start = () => {
pid = setInterval(() => {
@GeDiez
GeDiez / lift-kata.js
Created July 31, 2019 22:11
simulate lift using js
const initialState = {
floor: 0,
isOpen: false,
direction: 'up',
}
function Lift (state = initialState) {
console.table(state)
function request (floor) {
import React, { useState } from 'react';
import { Field, Input, Label, Control, Select, TextArea, Checkbox, Radio, Button, Help, Notification, Delete } from "bloomer";
import joinString from "classnames";
import { useForm } from "../Hooks";
export const FormExample = ({isHidden}) => {
const FIELD_REQUIRED = 'This field is required';
const SELECT_FIELD = 'Please select this field';
const NOTIFICATION_MESSAGE_SUCCESS = 'Success message here!';
@GeDiez
GeDiez / readme.md
Last active September 5, 2018 21:33

Nucleus

Nucleus is a library of web-components stand-alone for all products of MiFiel alt text

Getting Started

Simply add the follow tags into your html and ready! you can use them

@GeDiez
GeDiez / withCustomEvents.js
Created April 19, 2018 19:16
MAIN FUNCTION: HOC NucleusWrapper @description it HOC lets add custom events to html tags. @Usage you only need to import the HOC as follow: import NucleusWrapper from '../NucleusWrapper' then make a component with: const MiComponent = NucleusWrapper('mi-component') notice: this HOC just receives string tag as parameters. finally you can add you…
/*
MAIN FUCTION: HOC NucleusWrapper
@description
it HOC lets add custom events to html tags.
@usage
you only need to import the HOC as follow:
import NucleusWrapper from '../NucleusWrapper'
then make a component with:
@GeDiez
GeDiez / .jsx
Created March 21, 2018 20:38
Component React
const Tab = ({ dataTab, tabActive, onClick, children }) => {
const isActive = dataTab === tabActive;
return (
<li className={`vex_Tab-tab ${isActive ? 'is-active' : ''}`} onClick={onClick}>
{children}
</li>
);
};
Tab.propTypes = {
@GeDiez
GeDiez / .js
Last active March 21, 2018 00:59
Ejemplo crear objetos: puras funciones
const calculateIMC = (height, weight) => {
const imc = this.weight / Math.pow(this.height, 2).toFixed(2);
if(imc < 16){
return 'delgadez severa imc ' + imc;
}
if(imc < 16.99){
return 'delgadez moderada imc ' + imc;
}
if(imc < 18.49){
return 'delgadez aceptable imc ' + imc;