Skip to content

Instantly share code, notes, and snippets.

View ghetolay's full-sized avatar

Ghet ghetolay

  • Imbasoft
  • /Earth/Europe/France/Paris
View GitHub Profile
@micmro
micmro / fix-flex-svg-panels.html
Last active December 28, 2017 10:35
SVG with both fixed width (pixel) and flexible with (percentage) panels combined - https://jsfiddle.net/4xuLyvj9/ - does not work in IE/Edge due to lack of support for SVG in `foreignObject`
<html>
<body>
<svg width="100%" height="250" xmlns="http://www.w3.org/2000/svg">
<foreignObject id="fixed-panel" width="100" height="100%">
<svg width="100" xmlns="http://www.w3.org/2000/svg">
<rect x="0" y="0" width="100" height="100%" fill="#fcc" rx="5" ry="5"/>
<text x="5%" y ="25" width="100" fill="#333">fixed width</text>
</svg>
</foreignObject>
<foreignObject id="flex-panel" width="100%" height="100%" style="padding-left:100px;">
@paulirish
paulirish / what-forces-layout.md
Last active July 5, 2024 08:26
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
@ahankinson
ahankinson / gist:4945722
Created February 13, 2013 16:17
kdu_compress options
Usage:
"kdu_compress ...
-i <file 1>[*<copies>@<size>],... {see also `-fprec' & `-icrop'}
One or more input files. If multiple files are provided, they must be
separated by commas. Any spaces will be treated as part of the file
name. If any filename contains the optional "*<copies>@<size>" suffix,
that file actually contributes <copies> inputs, where the k'th copy
starts (k-1)*<size> bytes into the file; this is most useful for raw
files, allowing a single raw file to contribute multiple image
components.