Skip to content

Instantly share code, notes, and snippets.

View lilBunnyRabbit's full-sized avatar
🐰

Andraž Mesarič-Sirec lilBunnyRabbit

🐰
View GitHub Profile
@lilBunnyRabbit
lilBunnyRabbit / README.md
Last active January 13, 2026 13:30
Inject safe-area-inset into browser (Emulation.setSafeAreaInsetsOverride)

Quick experiment to test CSS safe-area-inset-* properties in Chrome. Uses the experimental CDP setSafeAreaInsetsOverride method to override safe area insets on the fly.

There aren't really any other free tools that let you do this easily. Hopefully this gets built into DevTools soon, but for now this works.

Usage

bun install
chmod +x index.ts
bun link chrome-safe-inset
@lilBunnyRabbit
lilBunnyRabbit / example.tsx
Last active December 5, 2025 10:46
Polymorphic React Component
const PolyComponent = createPolymorphic<
{
download?: boolean;
className?: string;
children?: React.ReactNode;
},
{
value: number;
}
@lilBunnyRabbit
lilBunnyRabbit / README.md
Last active February 18, 2025 12:28
Task Management System in Typescript

TypeScript Task Management System

Important

The task manager functionality previously available in this gist has been officially integrated into the @lilbunnyrabbit/task-manager package. For continued support and access to the latest features, please refer to the package.

This TypeScript project implements a sophisticated task management system, designed to facilitate the creation, execution, and monitoring of asynchronous and synchronous tasks in a structured and efficient manner. The system is built around two primary components: TaskManager and Task.

TaskManager serves as the central orchestrator for managing multiple tasks. It provides capabilities to queue tasks, control their execution (either sequentially or in parallel), and monitor their overall progress and status. This makes it ideal for scenarios where task

@lilBunnyRabbit
lilBunnyRabbit / EventEmitter.ts
Last active November 28, 2024 09:50
Event Handling in Typescript
/**
* Event listener function.
* The listener function's context (`this`) is bound to the EventEmitter instance.
*
* @template TEvents - Object type representing the event types with associated data types.
* @template TData - Data type that the event listener will receive.
* @template TEmitter - Type of the EventEmitter instance.
*/
export type EventListener<
TEvents extends Record<string | number | symbol, unknown>,
@lilBunnyRabbit
lilBunnyRabbit / Optional.ts
Last active November 28, 2024 08:37
TypeScript implementation of Java Optional
/**
* TypeScript implementation of {@link https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html java.util.Optional<T>}.
*
* A container object which may or may not contain a non-null value.
*
* @template T - the type of the value
*/
class OptionalValue<T> {
/**
* Creates an instance of `OptionalValue`.
@lilBunnyRabbit
lilBunnyRabbit / index.md
Last active January 16, 2025 11:59
Collection of FREE dev tools

Design

  • 100L5 - All online tools you need in one box for free. Build anything online with “all-in-one toolbox”. All tools are easy-to-use, blazing fast & free.
  • Super Designer - Create beautiful designs with a few clicks. Simple design tools to generate unique patterns, backgrounds, 3D shapes, colors & images for social media, websites and more
  • Free Tools by Softr - A collection of free tools by Softr, which you can use to create designs, edit and generate audio/video files, customize your website, and more.
  • loading.io - Build Your Ajax Loading Icons, Animated Text and More with SVG / CSS / GIF / PNG !
  • UIVERSE - Discover a wide range of open-source, customizable components for web and mobile applications on Uiverse. Browse an extensive selection of buttons, cards, loaders, inputs, and more to enhance your app's user interface and elevate your design experience.

Color

@lilBunnyRabbit
lilBunnyRabbit / ExampleService.ts
Last active June 5, 2023 13:01
React service | Brainstorming
export class ExampleService extends Service {
readonly startExample = this.observable(this._startExample);
private _startExample(
observer: ServiceObserver<{
progress: number;
}>,
test: string
): string {
observer.dispatch("progress", 1);
return test;
@lilBunnyRabbit
lilBunnyRabbit / lz77.ts
Last active December 12, 2024 22:09
LZ77
export namespace LZ77 {
export type Dict = [distance: number, length: number, character: string][];
export function encode_unlimited(data: string): Dict {
const dict: Dict = [[0, 0, data[0] || ""]];
for (let i = 1; i < data.length; i++) {
let best: [distance: number, length: number] = [0, 0];
for (let j = i - 1; j >= 0; j--) {
if (data[j] !== data[i]) continue;
@lilBunnyRabbit
lilBunnyRabbit / graphql.json
Last active February 7, 2023 21:37
VSCode Snippets
{
"create": {
"prefix": "create",
"body": [
"${1|mutation,query|} ${TM_FILENAME_BASE}($3) {",
"\t$2($3) {$0}",
"}"
]
}
}