Skip to content

Instantly share code, notes, and snippets.

View meduzen's full-sized avatar
🌍
<body> in Belgium, <head> worldwide.

Mehdi meduzen

🌍
<body> in Belgium, <head> worldwide.
View GitHub Profile
/**
* cloneNode(true), but also clones shadow roots.
* @param {Element}
* @param {ShadowRoot[]} [shadowRoots] Any closed shadow roots passed here will be included.
*/
function cloneWithShadowRoots(node, shadowRoots) {
function walk(node, clone) {
let shadow = node.shadowRoot || shadowRoots.find(r => r.host === node);
if (shadow) {
clone.attachShadow({ mode: shadow.mode }).append(...[].map.call(shadow.childNodes, c => c.cloneNode(true)));
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@MaybeThisIsRu
MaybeThisIsRu / category.svelte
Last active September 13, 2020 08:17
a11y while adding categories
<!--
Problem statement:
I'm writing an interactive category field.
I have three major things on play here:
1. A text input that is described by a paragraph above it
2. A datalist of categories received from the server
3. A list of checked checkboxes for each new category

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

@JudahGabriel
JudahGabriel / Resources.md
Last active October 26, 2021 17:58
Building rich app experiences with Progressive Web apps
@danielstgt
danielstgt / imagick3.4.4-PHP7.4-forge.sh
Last active April 19, 2024 11:33
Install ImageMagick / Imagick 3.4.4 on PHP 7.4 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.4.tgz
tar xvzf imagick-3.4.4.tgz
@meduzen
meduzen / voice-over-ecriture-dite-inclusive.html
Last active March 22, 2021 19:34
(For French person only)
<!-- « un neu concepteurice », says Voice Over -->
<p>Test 1 : nous recherchons un•e concepteur•rice & rédacteur•rice francophone.</p>
<!-- « une concepteurice », says Voice Over `(content: '•'` is ignored) -->
<p>Test 2 : nous recherchons un<span class="content-middot"></span>e concepteur<span class="content-middot"></span>rice & rédacteur<span class="content-middot"></span>rice francophone.</p>
<!-- `alt is ignored by macOS Voice Over -->
<p>Test 3 : nous recherchons <span alt="un concepteur et rédacteur, ou une conceptrice et rédactrice">un•e concepteur•rice & rédacteur•rice</span> francophone.</p>
<!-- `aria-label` or `aria-labelledby` is ignored by macOS Voice Over -->
Atmosphere Fatal Report (v1.0):
Result: 0x1BF802 (2002-3580)
Title ID: 010000000000000c
Process Name: bcat
Firmware: 9.0.0 (Atmosphere 0.9.4-master-c62c4846)
General Purpose Registers:
Start Address: 0000003551e00000
Stack Trace:
ReturnAddress[00]: 0000003551f79edc
@meduzen
meduzen / README.md
Last active August 31, 2020 11:17
Replace Nginx server name on Forge + Digital Ocean

Replace Nginx server name

This works on a Digital Ocean’s server managed by Laravel Forge. What this does:

  1. Power off the server by connecting through ssh and running sudo poweroff.
  2. Take a snapshot of the server in the Digital Ocean panel. If things goes wrong, it’ll help server restauration.
  3. Warning step:
@Venryx
Venryx / RomajiConverter.ts
Last active April 17, 2021 20:26
Hiragana/Katakana to Romaji Converter (Typescript/Javascript)
// Raw chart text obtained by simple copy-paste from: https://en.wikipedia.org/wiki/Hepburn_romanization#Romanization_charts
const rawChartText = `
あ ア a い イ i う ウ u え エ e お オ o
か カ ka き キ ki く ク ku け ケ ke こ コ ko きゃ キャ kya きゅ キュ kyu きょ キョ kyo
さ サ sa し シ shi す ス su せ セ se そ ソ so しゃ シャ sha しゅ シュ shu しょ ショ sho
た タ ta ち チ chi つ ツ tsu て テ te と ト to ちゃ チャ cha ちゅ チュ chu ちょ チョ cho
な ナ na に ニ ni ぬ ヌ nu ね ネ ne の ノ no にゃ ニャ nya にゅ ニュ nyu にょ ニョ nyo
は ハ ha ひ ヒ hi ふ フ fu へ ヘ he ほ ホ ho ひゃ ヒャ hya ひゅ ヒュ hyu ひょ ヒョ hyo
ま マ ma み ミ mi む ム mu め メ me も モ mo みゃ ミャ mya みゅ ミュ myu みょ ミョ myo
や ヤ ya ゆ ユ yu よ ヨ yo