Skip to content

Instantly share code, notes, and snippets.

@icnahom
icnahom / main.dart
Created May 23, 2024 11:10
GestureDetector's onDoubledTap Delay
import 'package:flutter/material.dart';
void main() => runApp(const MenuAnchorApp());
class MenuAnchorApp extends StatelessWidget {
const MenuAnchorApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
@icnahom
icnahom / main.dart
Created January 10, 2024 08:47
zealous-pool-3944
void main() {
final todos = signal([]);
print(todos.isEmpty);
final messages = signal({});
print(messages.keys);
}
Signal<T> signal<T>(T value) => Signal(value);
@icnahom
icnahom / sliver_magic.dart
Created July 21, 2023 09:51 — forked from slightfoot/sliver_magic.dart
Sliver Magic - by SImon Lightfoot - #HumpdayQandA - 19th July 2023 - #Flutter #Dart
// MIT License
//
// Copyright (c) 2023 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@icnahom
icnahom / rethinkdb_join.py
Last active March 23, 2022 16:30
getting docs by a foreign key
products = (
await r.table("saved")
.order_by(r.desc("saved_at"))
.filter(r.row["user_id"] == user_id)
.eq_join("product_id", r.table("products"))
.map(lambda doc: doc["right"].merge(make_merge_expr))
.limit(25)
.run(self.conn)
)