Skip to content

Instantly share code, notes, and snippets.

View grimalschi's full-sized avatar

Veaceslav Grimalschi grimalschi

View GitHub Profile
<?php
function creatium_embed($subdomain, $path) {
if (!function_exists('curl_init')) {
die('Error: curl module is missing');
}
if (strpos($subdomain, '/') !== false) {
die('Error: wrong subdomain');
}
@paulirish
paulirish / what-forces-layout.md
Last active May 29, 2025 16:48
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
@jayj
jayj / flexbox.less
Last active April 22, 2025 14:38
CSS3 Flexbox - LESS Mixins
// --------------------------------------------------
// Flexbox LESS mixins
// The spec: http://www.w3.org/TR/css3-flexbox
// --------------------------------------------------
// Flexbox display
// flex or inline-flex
.flex-display(@display: flex) {
display: ~"-webkit-@{display}";
display: ~"-ms-@{display}box"; // IE10 uses -ms-flexbox