Skip to content

Instantly share code, notes, and snippets.

View Mathspy's full-sized avatar
💭
Working on few big surprises! 🌸

Mathspy

💭
Working on few big surprises! 🌸
View GitHub Profile
@Mathspy
Mathspy / zero_alloc_html_rendere.rs
Last active November 19, 2021 09:10
Zero allocation HTML renderer with escaping
#![no_std]
extern crate alloc;
use alloc::borrow::Cow;
use core::iter;
enum Tag {
/// A non-HTML tag that renders into nothing for wrapping text
Fragment,
@Mathspy
Mathspy / cloudflare-workers-deno.ts
Created December 25, 2021 15:00
Deno types for CloudFlare Workers
interface ExecutionContext {
waitUntil(promise: Promise<any>): void;
passThroughOnException(): void;
}
interface ExportedHandler<Env = unknown> {
fetch?: ExportedHandlerFetchHandler<Env>;
scheduled?: ExportedHandlerScheduledHandler<Env>;
}
@Mathspy
Mathspy / comparison.md
Last active November 4, 2022 09:52
Visual diffing algorithms comparison

Thanks to Awesome Visual Regression Testing and Screenster.io for compiling lists of the things in the space. The research into what each uses was done by me through digging their code or their READMEs.

  • OSnap: ReasonML. Uses ODiff, the main contender I am looking at.
  • basset: Python. Uses a handrolled algorithm, looks fairly naive, only 63 lines of code
  • AyeSpy: JavaScript. Uses looks-same
  • Wraith: Ruby. Uses ImageMagick (shells out to it). Made by BBC lol
  • BackstopJS: JavaScript. Uses hash comparison then @mirzazeyrek/node-resemble-js a fork of Resemble.js.
  • Galen: Java. Uses a handrolled algorithm named rainbow4j. Think they might be looking for a new name now.
  • Creevey: JavaScript. Uses pixelmatch.