Skip to content

Instantly share code, notes, and snippets.

View Boehrsi's full-sized avatar

Boehrsi Boehrsi

View GitHub Profile
@Boehrsi
Boehrsi / flutter_driver_async_main.dart
Last active March 5, 2023 05:57
During development I encountered https://github.com/flutter/flutter/issues/41029 and didn't liked the solution with hardcoded waiting times. I'm now waiting for the first frame to be rastered successfully and ignoring errors in the meantime. This works well for my tests and avoids hardcoded timings, which often fail (e.g. on a different machine).
Future<FlutterDriver> setupAndGetDriver() async {
FlutterDriver driver = await FlutterDriver.connect();
var connected = false;
while (!connected) {
try {
await driver.waitUntilFirstFrameRasterized();
connected = true;
} catch (error) {}
}
return driver;
@Boehrsi
Boehrsi / validatorBookmarket.js
Created November 26, 2015 22:36
A simple and small bookmarklet which opens the validation for the website you viewed while clicking the bookmark. Creates a new tab. Tested and working with Chrome and Firefox.
javascript:window.open('https://html5.validator.nu/?doc='+encodeURIComponent(location.href));void(0);