This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://blog.logrocket.com/working-with-the-javascript-reflect-api/ | |
/* | |
Reflect.get() - získá hodnotu vlastnosti objektu | |
Reflect.set() - nastaví hodnotu vlastnosti objektu | |
Reflect.has() - kontroluje existenci vlastnosti (podobně jako operátor in) | |
Reflect.deleteProperty() - odstraní vlastnost objektu | |
Reflect.apply() - volá funkci s danými argumenty | |
Reflect.construct() - vytváří nové instance objektů (podobně jako operátor new) | |
Reflect.getPrototypeOf() - vrací prototyp objektu | |
Reflect.setPrototypeOf() - nastavuje prototyp objektu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* https://www.matuzo.at/blog/2025/never-lose-a-z-index-battle-again */ | |
button.a { | |
z-index: calc(infinity + 1); /* 2147483647 */ | |
background: green; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://javascript.plainenglish.io/the-battle-of-isolation-proxy-vs-web-workers-vs-iframe-in-frontend-development-%EF%B8%8F-3eaeef99a11d | |
// 1 | |
const sandbox = new Proxy(window, { | |
get(target, key) { | |
if (key === 'document') { | |
throw new Error('No access to DOM!'); | |
} | |
return Reflect.get(target, key); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:root { | |
--clr-primary: hsl(229 33% 21%); | |
--clr-secondary: #302047; | |
--clr-accent: hsl(21deg 85% 60%); | |
--wrapper-padding-inline: 1rem; | |
--wrapper-max-width: 50rem; | |
--section-padding-block: 3rem; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.content-grid { | |
--padding-inline: 1rem; | |
--content-max-width: 900px; | |
--breakout-max-width: 1200px; | |
--breakout-size: calc( | |
(var(--breakout-max-width) - var(--content-max-width)) / 2 | |
); | |
display: grid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.grid { | |
--grid-max-col-count: 3; | |
--grid-min-col-size: 200px; | |
--grid-gap: 1rem; | |
/* calculations, do not touch */ | |
--grid-col-size-calc: calc( | |
(100% - var(--grid-gap) * var(--grid-max-col-count)) / | |
var(--grid-max-col-count) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--ErrorBoundary.vue--> | |
<!-- https://vueschool.io/articles/vuejs-tutorials/what-is-a-vue-js-error-boundary-component/ --> | |
<script setup> | |
import { ref, computed } from 'vue' | |
// create an reactive container to store the potential error | |
const error = ref() | |
// using Vue's build in lifecycle hook | |
// listen for errors from components passed to the default slot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* https://codepen.io/kevinpowell/pen/yLWNbdJ */ | |
.overlay { | |
border-image: linear-gradient(hsl(240 100% 20% / 0.6), hsl(0 100% 20% / 0.6)) | |
fill 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* https://codepen.io/kevinpowell/full/vYvEdWG */ | |
.cluster { | |
outline: 5px solid hotpink; | |
padding: 1rem; | |
display: flex; | |
gap: 1rem; | |
flex-wrap: wrap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://medium.com/@hxu0407/master-these-8-promise-concurrency-control-techniques-to-significantly-improve-performance-5a1c199b6b3c | |
// 1. Promise.all: Execute in Parallel and Return Results Together | |
const promise1 = Promise.resolve(1); | |
const promise2 = Promise.resolve(2); | |
const promise3 = Promise.resolve(3); | |
Promise.all([promise1, promise2, promise3]) | |
.then(results => { | |
console.log(results); // Output: [1, 2, 3] |
NewerOlder