Skip to content

Instantly share code, notes, and snippets.

View Gianni03's full-sized avatar
🎸
Focusing

Gianni Pasquinelli Gianni03

🎸
Focusing
View GitHub Profile
@Gianni03
Gianni03 / rezise.js
Created January 2, 2024 15:15
useRezise
import { useState, useEffect } from 'react';
const useResize = () => {
const [screenSize, setScreenSize] = useState(window.innerWidth);
const handleResize = () => setScreenSize(window.innerWidth);
useEffect(() => {
window.addEventListener('resize', handleResize);
return () => {
@Gianni03
Gianni03 / 1-setup.js
Created December 15, 2023 13:25 — forked from getify/1-setup.js
find size of largest region in matrix... solutions are breadth-first iterative (2) and depth-first recursive (3)
// Adapted from: https://www.geeksforgeeks.org/find-length-largest-region-boolean-matrix/
"use strict";
var M1 = [
[ 0, 0, 1, 1, 0 ],
[ 1, 0, 1, 1, 0 ],
[ 0, 1, 0, 0, 0 ],
[ 0, 0, 0, 1, 1 ]
];
@Gianni03
Gianni03 / desafio.js
Last active November 24, 2023 13:16
APX Modulo 0
//ANTES DE EMPEZAR:
//Copia este código base completo en un nuevo archivo llamado desafio.js
//-----------------------------------------------------------------------//
//JUGADORES:
// NO MODIFICAR LOS NOMBRES DE ESTOS OBJETOS
// (El test automático les cambia los valores para probar que el resto
// de la lógica funcione bien)
@Gianni03
Gianni03 / ScrollToTop.jsx
Last active November 1, 2023 21:47
scrollToTop
import { useEffect, useState } from "react";
import { BiChevronUp } from "react-icons/bi"
const ScrollToTop = () => {
const [display, setDisplay] = useState(false)
useEffect(() => {
window.addEventListener("scroll", () => {
setDisplay(window.scrollY > 400)