Skip to content

Instantly share code, notes, and snippets.

View mvsde's full-sized avatar
🏳️‍⚧️
Protect trans kids!

Fynn Ellie Be mvsde

🏳️‍⚧️
Protect trans kids!
View GitHub Profile
@mvsde
mvsde / _device.md
Last active January 29, 2022 10:03
Image performance on a slow machine
@mvsde
mvsde / number-empty-string.md
Last active February 5, 2023 20:19
Why is `Number("") === 0`?

The case

This video by ThePrimeagen sent me on a fun archaeology trip.

The case to solve: Why is the following statement true? why is an empty string parsed as a number in JS?

Number("") === 0
@mvsde
mvsde / docker-reset.md
Created February 6, 2023 13:19
Unbreak Docker when everything is borked
@mvsde
mvsde / bind-attrs.js
Last active February 22, 2023 12:30
Split Vue 3 attrs into root and bind attrs for transparent components
import { computed, useAttrs } from "vue";
export function useBindAttrs() {
const attrs = useAttrs();
const rootAttrs = computed(() => ({
class: attrs.class,
style: attrs.style,
}));
@mvsde
mvsde / disable-css.js
Last active August 10, 2023 08:30
Accessibility testing bookmarklets
javascript:(function(){
document.querySelectorAll(`link[rel="stylesheet"], style`).forEach((element) => element.remove());
document.querySelectorAll(`*`).forEach((element) => element.removeAttribute(`style`));
})();