Skip to content

Instantly share code, notes, and snippets.

View aliakakis's full-sized avatar

Antonios Liakakis aliakakis

View GitHub Profile
@aliakakis
aliakakis / dynamic_queue.go
Last active March 31, 2026 11:23
Go dynamic queue
/*
Usage
q := NewQueue()
q.EnQueue(func() {
time.Sleep(2 * time.Second)
fmt.Println("Hello")
})
@aliakakis
aliakakis / lifecycle.hooks.ts
Created June 14, 2026 16:54
React Lifecycle Hooks
import { isEqual } from "lodash";
import { useEffect, useRef } from "react";
/**
* A hook that executes a callback function only once when the component is mounted.
*
* @param {Function} fn - The callback function to be executed during the component's mount phase.
* @return {void} This function does not return any value.
*/
export function useOnMount(fn: () => void) {