Skip to content

Instantly share code, notes, and snippets.

View luima's full-sized avatar
:octocat:

Luis Manuel Rodriguez Matos luima

:octocat:
View GitHub Profile
@stereokai
stereokai / gist:36dc0095b9d24ce93b045e2ddc60d7a0
Last active July 10, 2024 00:23
CSS rounded corners with gradient border
.rounded-corners-gradient-borders {
width: 300px;
height: 80px;
border: double 4px transparent;
border-radius: 80px;
background-image: linear-gradient(white, white), radial-gradient(circle at top left, #f00,#3020ff);
background-origin: border-box;
background-clip: padding-box, border-box;
}
@codeaid
codeaid / useTimeout.ts
Created November 10, 2020 20:03
React hook utilising setTimeout and exposing pause, resume and cancel callbacks
import { useCallback, useEffect, useRef } from 'react';
type UseTimeoutCallback = (...args: Array<any>) => void;
/**
* Set a timer, which executes a function once the timer expires. Exposes pause, resume and cancel
* callbacks to the consumers.
*
* @param {UseTimeoutCallback} fn Callback function to execute after the specified timeout
* @param {number} ms Timeout in milliseconds after which to execute the callback