<!-- definice SVG spritu -->
<svg class="shape-defs" width="0" height="0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<symbol id="shape-star" viewBox="0 0 23 21">
<path d="M11.5 16.34l-5.43 2.85 1.04-6.04-4.39-4.28
6.07-.88 2.71-5.49 2.71 5.49 6.07.88-4.39 4.28 1.04 6.04-5.43-2.85zm0 0"/>
</symbol>
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
console.log( | |
[...document.querySelectorAll('tr')] | |
.map((tr) => | |
[...tr.querySelectorAll('td:not(:last-child):not(:first-child)')] | |
.map((el) => `${el.textContent}`) | |
.join(' ') | |
.trim() | |
) | |
.filter(Boolean) | |
.join('\n\n') |
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
var docWidth = document.documentElement.offsetWidth; | |
[].forEach.call(document.querySelectorAll("*"), function (el) { | |
if (el.closest("svg")) { | |
return null; | |
} | |
if ( | |
el.offsetWidth > docWidth || | |
el.getBoundingClientRect().right > docWidth | |
) { | |
console.log({ |
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
(() => { | |
const data = {}; | |
document.querySelectorAll("*").forEach((el) => { | |
const style = window.getComputedStyle(el); | |
const font = String(style.fontFamily).split(",").shift().replace(/\"/g, ''); | |
data[font] = data[font] ?? {}; | |
data[font][style.fontWeight] = data[font][style.fontWeight] ?? 0; | |
data[font][style.fontWeight]++; | |
}); | |
console.log(JSON.stringify(data, null, 2)); |
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
My Awesome Sketch | |
First State | |
some event -> Trololo | |
Trololo |
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
<?php | |
/* | |
# Usage | |
# just prefix old function call with `Memoize::` | |
someFunction("foo", 123); | |
Memoize::someFunction("foo", 123); |
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
=overscrolls($topColor, $bottomColor, $darken: 10%) | |
@if $topColor | |
body::before | |
content: '' | |
position: fixed | |
right: 0 | |
left: 0 | |
z-index: -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
<?php | |
function templateString($subject, array $replace, $l = '%', $r = NULL) { | |
if(!$r) { | |
$r = $l; | |
} | |
return str_replace(array_map(function($s) use ($l, $r) { return "$l$s$r"; }, array_keys($replace)), array_values($replace), $subject); | |
} |
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
<?php | |
function yid($url) { | |
$pattern = '%^(?:https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com(?:/embed/|/v/|/watch\?v=))([\w-]{10,12})$%x'; | |
$result = preg_match($pattern, $url, $matches); | |
if ($result) { | |
return $matches[1]; | |
} | |
return false; | |
} |
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
{ | |
"Potrefená Husa": "https://www.zomato.com/cs/praha/potrefen%C3%A1-husa-n%C3%A1rodn%C3%AD-nov%C3%A9-m%C4%9Bsto-praha-1/menu", | |
"Bistro OS": "https://www.zomato.com/cs/praha/bistroos-nov%C3%A9-m%C4%9Bsto-praha-1/menu", | |
"U Medvídků": "https://www.zomato.com/cs/praha/restaurace-u-medv%C3%ADdk%C5%AF-star%C3%A9-m%C4%9Bsto-praha-1/menu", | |
"Modrá zahrada": "https://www.zomato.com/cs/praha/modr%C3%A1-zahrada-star%C3%A9-m%C4%9Bsto-praha-1/menu", | |
"La Piccola Perla": "https://www.zomato.com/praha/la-piccola-perla-star%C3%A9-m%C4%9Bsto-praha-1/menu", | |
"Café Louvre": "https://www.zomato.com/praha/caf%C3%A9-louvre-nov%C3%A9-m%C4%9Bsto-praha-1/menu", | |
"Hlávkův Dvůr": "https://www.zomato.com/praha/hl%C3%A1vk%C5%AFv-dv%C5%AFr-1-nov%C3%A9-m%C4%9Bsto-praha-1/menu" | |
} |