Skip to content

Instantly share code, notes, and snippets.

View arsenstorm's full-sized avatar
👻

Arsen Shkrumelyak arsenstorm

👻
  • London, UK
  • 03:23 (UTC +01:00)
View GitHub Profile
@KristofferEriksson
KristofferEriksson / useSpeechToText.ts
Last active February 20, 2024 05:33
An experimental React hook for real-time speech-to-text using the Web Speech API
import { useCallback, useEffect, useState } from "react";
// Define custom types for SpeechRecognition and SpeechRecognitionEvent
interface ISpeechRecognitionEvent extends Event {
results: SpeechRecognitionResultList;
resultIndex: number;
}
interface ISpeechRecognition extends EventTarget {
lang: string;
@KristofferEriksson
KristofferEriksson / useUndo.ts
Created January 31, 2024 11:34
A React hook that enhances your components with powerful undo/redo functionality
import { useCallback, useEffect, useRef, useState } from "react";
interface UseUndoHook<T> {
value: T;
onChange: (newValue: T) => void;
undo: () => void;
redo: () => void;
clear: () => void;
canUndo: boolean;
canRedo: boolean;
@KristofferEriksson
KristofferEriksson / useLongPress.ts
Created January 24, 2024 11:05
A simple useLongPress hook for React
import { useCallback, useEffect, useRef } from "react";
export function useLongPress({
delay,
onLongPress,
onClick,
onCancel,
onFinish,
onStart,
}: {
@arsenstorm
arsenstorm / halloween.css
Last active March 2, 2023 21:22
Github Halloween Contributions Theme
/* Installation:
- Download the Stylebot Extension
- Create a new style for the URL https://github.com
- Paste this code into the new style
- Ensure that the style is enabled
- Head over to your Github Profile Page
*/
.ContributionCalendar-day[data-level="1"] {
fill: var(--color-calendar-halloween-graph-day-L1-bg) !important;
@gmastr
gmastr / readme.txt
Created April 9, 2021 10:40
HIDE?. (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html