Skip to content

Instantly share code, notes, and snippets.

My <body> is in Belgium, my <head> worldwide.

Mehdi meduzen

My <body> is in Belgium, my <head> worldwide.
View GitHub Profile
meduzen /
Last active Jul 26, 2021
Get all files path in a PR, excluding the files marked as viewed or deleted
  1. Open your dev tools.
  2. Paste this in the console:
  .filter(el => !('fileUserViewed' in el.dataset) && el.dataset.fileDeleted == 'false')
  .map(el => el.querySelector('.file-header').dataset.path)
meduzen / remove-duplicates-from-array.js
Last active Mar 10, 2021
JavaScript Set explained
View remove-duplicates-from-array.js
// Embedded in
// OMG, lot of duplicated entries!
const stepsNames = [
meduzen / timer.js
Last active Mar 10, 2021
Approach for using setInterval / setTimeout in a vue-x store
View timer.js
const state = {
now: (new Date()),
intervalTimer: null,
const mutations = {
now(state) { = new Date();
meduzen / unregister-service-workers.js
Created Jul 14, 2020
Run this in your browser console or in your app to clean all Service Workers.
View unregister-service-workers.js
if('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(function(registrations) {
for(let registration of registrations) {
View fr.json
"label": "Français",
"keys": {
"answer_no": "Non",
"answer_region_no": "Je ne me suis rendu dans aucune des régions mentionnées ci-dessus",
"answer_unknown": "Je ne sais pas",
"answer_yes": "Oui",
"answers_table_headline": "Vos réponses",
"answers_table_hide_answers": "Cacher les réponses",
"answers_table_print": "Imprimer",
meduzen /
Created Feb 17, 2020
Having FFMpeg working on Ubutu or macOS for Spatie Media Library

Spatie’s Media Library requires FFmpeg in order to create video poster images.

Install FFmpeg

On Ubuntu

  • sudo apt update;
  • sudo apt install ffmpeg;
  • ffmpeg -version should output FFmpeg version.
View voice-over-ecriture-dite-inclusive.html
<!-- « 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 -->
meduzen /
Created Jan 4, 2020
Notes about FFMPEG


ffmpeg -i smb-bump.wav -c:a flac -compression_level 8 -map_metadata -1 smb-bump.flac
  • -c:a flac for FLAC.
  • -compression_level 8: 0 is low compression (faster to decode), 12 is highest, but following this thread, you should never go above 8.
meduzen /
Last active Nov 15, 2019
Service Workers resources