Skip to content

Instantly share code, notes, and snippets.

View giri-jeedigunta's full-sized avatar
...

Giri Jeedigunta giri-jeedigunta

...
View GitHub Profile
@Nash0x7E2
Nash0x7E2 / Allow-multiple-gestures.dart
Last active June 30, 2024 17:40
[DEPRECATED] Sample code on how to enable gesture pass through so that both the parent and the child widget receive the gesture.
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
//Main function. The entry point for your Flutter app.
void main() {
runApp(
MaterialApp(
home: Scaffold(
body: DemoApp(),
),
@dherges
dherges / lru-cache.ts
Last active May 26, 2023 04:39
Simple LRU Cache in TypeScript
class LruCache<T> {
private values: Map<string, T> = new Map<string, T>();
private maxEntries: number = 20;
public get(key: string): T {
const hasKey = this.values.has(key);
let entry: T;
if (hasKey) {
// peek the entry, re-insert for LRU strategy