Skip to content

Instantly share code, notes, and snippets.

/// Dependencies
abstract interface class Dependencies {
/// The state from the closest instance of this class.
factory Dependencies.of(BuildContext context) => InheritedDependencies.of(context);
/// App metadata
abstract final AppMetadata appMetadata;
/// Database
abstract final Database database;
@adomhamza
adomhamza / text-editing-controller-animated-builder.dart
Created October 13, 2021 22:46 — forked from bizz84/flutter-text-field-validation.dart
TextField validation made easy with TextEditingController and AnimatedBuilder
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@danielgindi
danielgindi / delete_bitbucket_lfs_files.js
Last active November 8, 2024 17:14
Bulk delete Bitbucket LFS files
(() => {
// Run this in Chrome's console, while in Bitbucket's website and logged in
const csrftoken = document.cookie.match(/\bcsrftoken=(.*?)(?:;| |$)/)[1];
const repoName = window.__initial_state__.section.repository.currentRepository.full_name;
const expiry = 1000 * 60 * 60; // Delete only files older than an hour
let page = 1;
function iterateNext() {
fetch(`https://bitbucket.org/${repoName}/admin/lfs/file-management/?iframe=true&spa=0&page=${page}`, {
@mitsuoka
mitsuoka / TimerIsolateLibrary.dart
Last active March 17, 2025 09:31
Dart code sample of a precision timer isolate.
/*
Dart code sample : Timer Isolate
Function timerIsolate provides your application with accurate timings with
+/- few mS accuracy depending on your pc's performance.
note : Windows Vista, Windows Server 2008, Windows 7 or later required for this code.
To try this sample:
1. Put these codes into the holder named TimerIsolateSample.