Skip to content

Instantly share code, notes, and snippets.

View landsman's full-sized avatar

Michal Landsman landsman

View GitHub Profile
@stibi
stibi / lvm.md
Last active December 28, 2018 11:01

LVM

Volné místo

pvs nebo vgs ukáže, jestli na physical volume nebo volume grupě je nějaké volné místo

Zvětšit logical volume

Mám srv_data_postgresql logical volume a chci mu přidat 50G.

@bvaughn
bvaughn / index.md
Last active April 3, 2024 07:41
Interaction tracing with React

This API was removed in React 17


Interaction tracing with React

React recently introduced an experimental profiler API. After discussing this API with several teams at Facebook, one common piece of feedback was that the performance information would be more useful if it could be associated with the events that caused the application to render (e.g. button click, XHR response). Tracing these events (or "interactions") would enable more powerful tooling to be built around the timing information, capable of answering questions like "What caused this really slow commit?" or "How long does it typically take for this interaction to update the DOM?".

With version 16.4.3, React added experimental support for this tracing by way of a new NPM package, scheduler. However the public API for this package is not yet finalized and will likely change with upcoming minor releases, so it should be used with caution.

@hrach
hrach / channel.kt
Last active May 24, 2021 08:52
Kotlin Channels Debounce & Throttle
import kotlinx.coroutines.experimental.*
import kotlinx.coroutines.experimental.channels.ReceiveChannel
import kotlinx.coroutines.experimental.channels.consumeEach
import kotlinx.coroutines.experimental.channels.produce
import kotlin.coroutines.experimental.CoroutineContext
fun <E> ReceiveChannel<E>.debounce(
wait: Long = 50,
context: CoroutineContext = DefaultDispatcher
): ReceiveChannel<E> = produce(context) {
@brablc
brablc / shoptet-addon-html-codes-example.html
Last active July 7, 2019 18:20
Shoptet add-on HTML codes example
<script type="text/javascript">
var demoPartner = { 'host': '#HOST#', 'projectId': #PROJECT_ID#, 'template': '#TEMPLATE#' };
</script>
<script src="https://cdn.myshoptet.com/usr/demo-partner.myshoptet.com/user/documents/addon_1/common.js" type="text/javascript"></script>
<link href="https://cdn.myshoptet.com/usr/demo-partner.myshoptet.com/user/documents/addon_1/#TEMPLATE#.css" rel="stylesheet" />
<link href="https://cdn.myshoptet.com/usr/demo-partner.myshoptet.com/user/documents/addon_1/#HOST#/style.css?v=1" rel="stylesheet" />
@pento
pento / php-block.js
Last active February 29, 2024 01:31
Converting a shortcode to a block: this method is fast to do, but a mediocre UX. You should only use this as a stopgap until you can implement a full block UI.
// License: GPLv2+
var el = wp.element.createElement,
registerBlockType = wp.blocks.registerBlockType,
ServerSideRender = wp.components.ServerSideRender,
TextControl = wp.components.TextControl,
InspectorControls = wp.editor.InspectorControls;
/*
* Here's where we register the block in JavaScript.
@rozenmd
rozenmd / macOS-setup.sh
Last active August 1, 2023 22:40
Set up a macOS device for development in one script.
#!/bin/bash
# Brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
####################################
# Brew apps
####################################
brew install cask
@pantsel
pantsel / docker-compose.yml
Last active May 13, 2024 14:29
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@dluc
dluc / IgnoreTrailingSlashesRequestHandler.java
Created July 10, 2018 01:47
Play Framework 2.6 Request Handler to ignore trailing slash
import com.google.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import play.api.mvc.Handler;
import play.api.mvc.Handler$;
import play.api.mvc.RequestHeader;
import play.core.j.JavaHandler;
import play.core.j.JavaHandlerComponents;
import play.http.HandlerForRequest;
import play.http.HttpRequestHandler;
import play.libs.streams.Accumulator;
@dg
dg / composing.presenters.php
Created May 31, 2018 14:00
Composing presenters without inheritance
<?php
// composing presenters without inheritance
// (requires nette/application 2.4.11)
trait RequireLoggedUser
{
public function injectRequireLoggedUser()
{
@sairamkrish
sairamkrish / Dockerfile
Last active January 4, 2022 23:27
Dockerfile for gradle, spring boot application using multi-stage feature
FROM openjdk:8 AS TEMP_BUILD_IMAGE
ENV APP_HOME=/usr/app/
WORKDIR $APP_HOME
COPY build.gradle settings.gradle gradlew $APP_HOME
COPY gradle $APP_HOME/gradle
RUN ./gradlew build || return 0
COPY . .
RUN ./gradlew build
FROM openjdk:8