Skip to content

Instantly share code, notes, and snippets.

View JosefJezek's full-sized avatar

Josef Ježek JosefJezek

  • Heart of Europe
View GitHub Profile
@vikpe
vikpe / fix_authenticity_of_github_problem.md
Last active April 25, 2024 03:01
FIX: The authenticity of host github.com can't be established.

Error

The authenticity of host 'github.com (140.82.113.4)' can't be established.

Fix

ssh-keyscan github.com >> ~/.ssh/known_hosts
@gvoze32
gvoze32 / ffmpeg GIF to MP4.MD
Last active April 17, 2024 20:51
Convert animated GIF to MP4 using ffmpeg in terminal.

To convert animation GIF to MP4 by ffmpeg, use the following command

ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4

Description

movflags – This option optimizes the structure of the MP4 file so the browser can load it as quickly as possible.

pix_fmt – MP4 videos store pixels in different formats. We include this option to specify a specific format which has maximum compatibility across all browsers.

@ebidel
ebidel / download_chrome41.js
Last active February 14, 2024 01:56
For when you need to test your site in Google Search (Chrome 41).
/**
* Copyright 2018 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@surma
surma / findall_elements_deep.js
Last active October 25, 2020 16:41 — forked from ebidel/findall_elements_deep.js
Finds all elements on the page, including those within shadow dom — iterator version
/**
* Inspired by ebidel@ (https://gist.github.com/ebidel/1b418134837a7dde7d76ed36288c1d16)
* @author surma@
* License Apache-2.0
*/
function* collectAllElementsDeep(selector = '*', root = document.all) {
for (const el of root) {
if (!el.matches(selector))
continue;
@briansalvattore
briansalvattore / api.js
Created March 16, 2018 22:42
Proxy to run Firebase Functions
'use strict';
const admin = require('firebase-admin');
module.exports = function (app) {
app.get('/api', function (req, res) {
res.json({ 'version': '0.1' })
});
@nickytonline
nickytonline / async-awaitable-dom-event-handler.js
Last active September 6, 2022 15:25
async/await"able DOM event handlers
// async/await"able" DOM event handlers
async function getMeSomeData() {
// ...
return data
}
document.addEventListener('DOMContentLoaded', async () => {
const someContainer = document.getElementById('someContainer');
@kevinpschaaf
kevinpschaaf / 0. Custom Elements + Redux toolbox & examples.md
Last active July 21, 2020 06:48
Custom Elements + Redux toolbox & examples

An approach to binding Redux to custom elements

The code here captures some of the patterns I used in the "real estate" demo app discussed in my talk End to End Apps with Polymer from Polymer Summit 2017.

There are many ways to connect Redux to custom elements, and this demonstrates just one pattern. The most important aspects are to try and lazily-load as much of the otherwise global state management logic along with the components that need them (as shown via the lazyReducerEnhancer and addReducers calls in the connected components), and to consider the tradeoffs you make in terms of coupling components to the store.

The pattern shown here of creating a stateless component and then a subclass that connects it to the store addresses a potential desire to reuse app-level stateless components between more than one application context, so the subclass provides a degree of decoupling from the concrete store, at the expense of more boilerplate. If app com

@robdodson
robdodson / index.html
Last active October 4, 2023 18:57
Shady DOM example
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<h2>Hello from outside the Shadow DOM!</h2>
@praveenpuglia
praveenpuglia / shadow-dom.md
Last active March 28, 2024 15:06
Everything you need to know about Shadow DOM

I am moving this gist to a github repo so more people can contribute to it. Also, it makes it easier for me to version control.

Please go to - https://github.com/praveenpuglia/shadow-dom-in-depth for latest version of this document. Also, if you find the document useful, please shower your love, go ⭐️ it. :)

Shadow DOM

Heads Up! It's all about the V1 Spec.

In a nutshell, Shadow DOM enables local scoping for HTML & CSS.

@MichaelLawton
MichaelLawton / install-bluez-5.43.sh
Created February 11, 2017 02:53
How to use web bluetooth in Chrome/Opera on Ubuntu 16.04
# Download and install BlueZ 5.43 and libreadline7 packages
wget http://mirrors.kernel.org/ubuntu/pool/main/r/readline/libreadline7_7.0-0ubuntu2_amd64.deb
wget http://ftp.debian.org/debian/pool/main/b/bluez/bluez_5.43-1_amd64.deb
sudo dpkg -i libreadline7_7.0-0ubuntu2_amd64.deb
sudo dpkg -i bluez_5.43-1_amd64.deb
# Restart system or BlueZ service
# Enable chrome://flags/#enable-experimental-web-platform-features and restart Chrome