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
@reinink
reinink / AddressInput.vue
Last active February 17, 2021 14:03
Multiple v-models in Vue 3
<template>
<input type="text" :value="address" @input="$emit('update:address', $event.target.value)">
<input type="text" :value="city" @input="$emit('update:city', $event.target.value)">
<input type="text" :value="region" @input="$emit('update:region', $event.target.value)">
<input type="text" :value="country" @input="$emit('update:country', $event.target.value)">
<input type="text" :value="postal" @input="$emit('update:postal', $event.target.value)">
</template>
<script setup>
import { defineProps } from 'vue'
@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 -->
@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
@martinherweg
martinherweg / browserSync.js
Last active May 29, 2021 08:07
Webpack + BrowserSync + HMR
/**
|--------------------------------------------------------------------------
| gulp browser-sync
|--------------------------------------------------------------------------
*
* Browser Sync
* @description Refresh the Brwoser after File Change.
* Combined with webpack for HMR or Content Reload
*
* @package generator-mh-boilerplate
B7ED7A66C80B4B008BAF7F0589C08224
All the cool kids post mysterious RNG seeds.
This isn't anything particularly useful or important, uncovered ages ago but apparently there are still 0 google search results for it.
First, I guess.
@JudahGabriel
JudahGabriel / Resources.md
Last active October 26, 2021 17:58
Building rich app experiences with Progressive Web apps
@tombennet
tombennet / preserve-pixelation.scss
Last active February 6, 2022 00:06
Preserve pixelation when scaling pixel art with CSS - https://builtvisible.com/image-scaling-in-css/
@mixin pixelated {
-ms-interpolation-mode: nearest-neighbor; // IE 7+ (non-standard property)
image-rendering: -webkit-crisp-edges; // Safari 6 - 9
image-rendering: -moz-crisp-edges; // Firefox 3.6 - 64
image-rendering: crisp-edges; // Firefox 65+
image-rendering: pixelated; // Chrome 41+, Edge 76+, Safari 10+
}
@jrmadsen67
jrmadsen67 / gist:bd0f9ad0ef1ed6bb594e
Last active February 15, 2022 08:41
Laravel Quick Tip: Handling CsrfToken Expiration gracefully
Quick tip for handling CSRF Token Expiration - common issue is when you use csrf protection is that if
a form sits there for a while (like a login form, but any the same) the csrf token in the form will
expire & throw a strange error.
Handling it is simple, and is a good lesson for dealing with other types of errors in a custom manner.
In Middleware you will see a file VerifyCsrfToken.php and be tempted to handle things there. DON'T!
Instead, look at your app/Exceptions/Handler.php, at the render($request, Exception $e) function.
All of your exceptions go through here, unless you have excluded them in the $dontReport array at the
@davidhund
davidhund / accessible-svg-sprite-icons.md
Last active March 27, 2022 12:18
Figuring out the most robust, accessible markup for SVG Sprite Icons

(as a reply to: https://css-tricks.com/svg-use-with-external-reference-take-2/)

While I love SVG (sprites) there are a lot of issues to take into account.

Advocating The Most Accessible Markup

UPDATE: you should take a look at https://dl.dropboxusercontent.com/u/145744/accessible-svg-icon/test.html which seems a simpler and more robust approach

Another thing: since people copy-paste our code examples it would be great if we could advocate the most robust and accessible markup IMO. I am no a11y expert, but in my understanding we could/should take some extra steps to make out SVG sprite icons more accessible.

@lazamar
lazamar / loadPageSection.js
Last active April 12, 2022 21:53
Vanilla JS implementation of JQuery's .load
/**
* Loads an HTML document from a URL and retuns an element selected using
* the 'selector' parameter
* Example usage:
* loadPageSection('./myPage.html', '#container', (r, err) => console.log(r, err));
*
* @method loadPageSection
* @param {String} url
* @param {String} selector - A valid CSS selector
* @param {Function} callback - To be called with two parameters (response, error)