Skip to content

Instantly share code, notes, and snippets.

View jirimatousek's full-sized avatar

Jiří Matoušek jirimatousek

  • Brno, Czech Republic
View GitHub Profile
SELECT date,
case when date = (select max(date) from `chrome-ux-report.materialized.metrics_summary`) then "Latest" else "Historical" end as latest,
origin,
slow_fcp,avg_fcp,fast_fcp,
slow_lcp,avg_lcp,fast_lcp,
small_cls,medium_cls,large_cls
FROM `chrome-ux-report.materialized.metrics_summary`
WHERE origin in (
"https://www.example.cz",
@jirimatousek
jirimatousek / bootstrap-modal-fix-ios-background-scrolling.js
Created April 18, 2019 08:38 — forked from kweij/bootstrap-modal-fix-ios-background-scrolling.js
JavaScript-only fix for the background scrolling in Bootstrap modals on iOS (Safari)
let previousScrollY = 0;
$(document).on('show.bs.modal', () => {
previousScrollY = window.scrollY;
$('html').addClass('modal-open').css({
marginTop: -previousScrollY,
overflow: 'hidden',
left: 0,
right: 0,
top: 0,
@jirimatousek
jirimatousek / onViewport.js
Created January 30, 2018 12:45 — forked from eltonmesquita/onViewport.js
A simple jQuery function that adds a class when the target(s) is in the viewport
function onViewport(el, elClass, offset, callback) {
/*** Based on http://ejohn.org/blog/learning-from-twitter/ ***/
var didScroll = false;
var this_top;
var height;
var top;
if(!offset) { var offset = 0; }
$(window).scroll(function() {
@jirimatousek
jirimatousek / index.html
Created January 12, 2018 06:59 — forked from yavuztas/index.html
remove-rubber-band-web-apps-ios
<!DOCTYPE html>
<html>
<head>
<title>Remove rubberband scrolling from web apps on mobile safari and standalone (iOS)</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-touch-fullscreen" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<style>
html, body {margin: 0; padding: 0; width:100%; height:100%; overflow: hidden; background: #333}
p.center {
<svg preserveAspectRatio="xMinYMin" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 0 560 1388">
<defs>
<mask id="canTopMask">
<image width="560" height="1388" xlink:href="img/can-top-alpha.png"></image>
</mask>
</defs>
<image mask="url(#canTopMask)" id="canTop" width="560" height="1388" xlink:href="can-top.jpg"></image>
</svg>
@jirimatousek
jirimatousek / gfonts.php
Created January 26, 2017 12:00 — forked from nikoskip/gfonts.php
Demo: http://nikoskip.me/gfonts.php | You only have to use the CSS import URL that Google gives you, for instance: http://fonts.googleapis.com/css?family=Cabin:500,700,500italic,700italic
<?php
$fontTypes = array('woff2', 'woff', 'ttf', 'svg', 'eot');
$gFontURL = 'http://fonts.googleapis.com/css?family=';
$uaFonts = array(
'woff2' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36',
'woff' => 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0; Trident/4.0; GTB7.4; InfoPath.3; SV1; .NET CLR 3.1.76908; WOW64; en-US)',
'ttf' => 'Mozilla/5.0 (Linux; U; Android 2.2.1; en-ca; LG-P505R Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1',
'svg' => 'Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10',
@jirimatousek
jirimatousek / SassMeister-input.scss
Created September 30, 2016 20:08 — forked from Rplus/SassMeister-input.scss
Generated by SassMeister.com.
// ----
// libsass (v3.3.2)
// ----
@function nth-selector($str, $n) {
@for $i from 1 through $n {
@if (str_index($str, ' ')) {
@if $i == $n {
$str: str_slice($str, 0, str_index($str, ' ') - 1);
} @else {
@jirimatousek
jirimatousek / SassMeister-input.scss
Last active August 26, 2016 08:15
Generated by SassMeister.com.
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
$myset1: wsection-white wsection-gray;
$myset2: wsection-black wsection-darkgray;
//Toto by nefungovalo pro spojení listů argumentů do nového listu