Skip to content

Instantly share code, notes, and snippets.

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

Mehdi meduzen

🌍
My <body> is in Belgium, my <head> worldwide.
View GitHub Profile
@meduzen
meduzen / README.md
Last active Jul 26, 2021
Get all files path in a PR, excluding the files marked as viewed or deleted
View README.md
  1. Open your dev tools.
  2. Paste this in the console:
Array
  .from(document.querySelectorAll('.js-file'))
  .filter(el => !('fileUserViewed' in el.dataset) && el.dataset.fileDeleted == 'false')
  .map(el => el.querySelector('.file-header').dataset.path)
@meduzen
meduzen / remove-duplicates-from-array.js
Last active Mar 10, 2021
JavaScript Set explained
View remove-duplicates-from-array.js
// Embedded in https://twitter.com/meduzen/status/1369679118992871428
// OMG, lot of duplicated entries!
const stepsNames = [
"step-basic",
"step-basic",
"step-basic",
"step-specification",
"step-specification",
"step-specification",
@meduzen
meduzen / timer.js
Last active Mar 10, 2021
Approach for using setInterval / setTimeout in a vue-x store
View timer.js
const MILLISECONDS_PER_MINUTES = 1000 * 60;
const state = {
now: (new Date()),
intervalTimer: null,
};
const mutations = {
now(state) {
state.now = new Date();
@meduzen
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) {
registration.unregister()
}
})
}
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
meduzen / laravel-medialibrary-ffmpeg-settings-for-macos-and-ubuntu.md
Created Feb 17, 2020
Having FFMpeg working on Ubutu or macOS for Spatie Media Library
View laravel-medialibrary-ffmpeg-settings-for-macos-and-ubuntu.md

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 fosdem-2020-02-01.md
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
meduzen / ffmpeg.md
Created Jan 4, 2020
Notes about FFMPEG
View ffmpeg.md

Audio

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
meduzen / service-workers-resources.md
Last active Nov 15, 2019
Service Workers resources
View service-workers-resources.md