Skip to content

Instantly share code, notes, and snippets.

View renntbenrennt's full-sized avatar
🚶‍♂️

Benjamin renntbenrennt

🚶‍♂️
View GitHub Profile
@renntbenrennt
renntbenrennt / getImageInfo.dart
Created April 3, 2020 14:09
helper function for getting the info of Image getting from internet or base64
dynamic getImageInfo(String base64String) async {
Completer<ui.Image> completer = new Completer<ui.Image>();
imageFromBase64String(base64String)
.resolve(
ImageConfiguration(),
)
.addListener(
ImageStreamListener(
(ImageInfo info, bool _) => completer.complete(info.image),
),
@renntbenrennt
renntbenrennt / explanation.js
Created September 1, 2019 08:40
I need explanation of this crazy function I found in YDKJS Types and Grammar P54
// what the f is going on???
// and by the way, this is not cool at all!
// 😫
function isThisCool(vals, fn, rx) {
vals = vals || Array.prototype;
fn = fn || Function.prototype;
rx = rx || RegExp.prototype;
return rx.test(vals.map(fn).join(""));