Skip to content

Instantly share code, notes, and snippets.

View pascalduez's full-sized avatar

Pascal Duez pascalduez

View GitHub Profile
@samthor
samthor / safari-nomodule.js
Last active August 21, 2025 09:53
Safari 10.1 `nomodule` support
// UPDATE: In 2023, you should probably stop using this! The narrow version of Safari that
// does not support `nomodule` is probably not being used anywhere. The code below is left
// for posterity.
/**
* Safari 10.1 supports modules, but does not support the `nomodule` attribute - it will
* load <script nomodule> anyway. This snippet solve this problem, but only for script
* tags that load external code, e.g.: <script nomodule src="nomodule.js"></script>
*
* Again: this will **not** prevent inline script, e.g.:
@srdjan
srdjan / 100+ different counter apps...
Last active August 28, 2025 18:36
100+ different js counter apps...
100+ different js counter apps...
@ffoodd
ffoodd / improved-sr-only.markdown
Last active July 11, 2025 11:22
Improved .sr-only

Improved .visually-hidden

Theorically bulletproof CSS class for visually hide anything and keep it accessible to ATs.

A Pen by ffoodd on CodePen.

License.

@CMCDragonkai
CMCDragonkai / job_control_zsh_bash.md
Last active July 9, 2025 12:52
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background
@davatron5000
davatron5000 / the-state-of-element-container-queries.md
Last active August 23, 2023 15:43
The State of Element/Container Queries

The State of Container Queries

tl;dr Developers would like the idea to style components based on a parent's width rather than depend solely on the viewport media query. This would allow modular components to style themselves while being agnostic to the viewport.

There is currently a lot of developer interest in getting a feature like Container Queries (née "Element Queryies") shipped in a browser.

2-min Catchup

Here are official'ish documents to outline the developer community's desires.

@jlongster
jlongster / immutable-libraries.md
Last active November 7, 2024 13:11
List of immutable libraries

A lot of people mentioned other immutable JS libraries after reading my post. I thought it would be good to make a list of available ones.

There are two types of immutable libraries: simple helpers for copying JavaScript objects, and actual persistent data structure implementations. My post generally analyzed the tradeoffs between both kinds of libraries and everything applies to the below libraries in either category.

Libraries are sorted by github popularity.

Persistent Data Structures w/structural sharing

@paulirish
paulirish / what-forces-layout.md
Last active August 28, 2025 15:03
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@MoOx
MoOx / index.md
Last active August 29, 2015 14:17
OS X IRC apps
anonymous
anonymous / index.html
Created December 19, 2014 18:01
French Line // source http://jsbin.com/pigakarota
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>French Line</title>
<style id="jsbin-css">
body {
display: flex;
flex-direction: column;
flex-wrap: wrap;
@KittyGiraudel
KittyGiraudel / SassMeister-input.scss
Last active August 29, 2015 14:11
Generated by SassMeister.com.
// ----
// Sass (v3.4.9)
// Compass (v1.0.1)
// ----
/// Constant maps
/// Should not be dynamically updated.
/// @access private
/// @prop {List} TIME - List of `<time>` units
/// @prop {List} FREQUENCY - List of `<frequency>` units