Skip to content

Instantly share code, notes, and snippets.

View landsman's full-sized avatar

Michal Landsman landsman

View GitHub Profile
@dhoeric
dhoeric / 0_README.md
Last active December 2, 2025 21:02
Google Calendar - Public Holiday Calendars
@dtmilano
dtmilano / colors
Created November 26, 2019 01:31
Shows terminal colors
#! /bin/bash
n=32
arg=setaf
text='Hello World! This is %s %d'
_help()
{
printf 'usage: %s [--help|-H] [--16] [--256] [-t|--tiny] [--background|-b]\n' "$(basename $0)"
exit 0
@sgyyz
sgyyz / uao.md
Last active May 3, 2024 14:15
uao command - unzip your project and import to intellij automatically
  1. import project into idea command
$ curl -L "https://gist.githubusercontent.com/chrisdarroch/7018927/raw/9a6d663fd7a52aa76a943fe8a9bc6091ad06b18d/idea" -o /usr/local/bin/idea
$ chmod +x /usr/local/bin/idea
  1. unzip and open project command
$ curl -L "https://gist.githubusercontent.com/sgyyz/adfa4f05af3d81cf0e17e19cf7044c85/raw/b6b9e871d5a4f5435a09d00b0a52e3db0b90699a/uao.sh" -o /usr/local/bin/uao.sh
$ chmod +x /usr/local/bin/uao.sh
$ ln -sf /usr/local/bin/uao.sh /usr/local/bin/uao
@stibi
stibi / gist:20b0a5d496bdbd5073dde50662fa9b25
Created December 28, 2018 10:45
Open VPN connection, read oauth token from yubikey
#!/usr/bin/expect
set username "mstiborsky\r"
set config "/etc/openvpn/client/zonky.conf"
set vpn_oauth_token [exec ykman oath code -s vpn]
spawn openvpn --config $config --auth-user-pass
expect "Enter Auth Username:"
send $username
expect "Enter Auth Password:"
@stibi
stibi / cmd.md
Last active January 13, 2019 21:08

Find biggest dirs on ...

du -Sh | sort -rh | head -5

Number sequence loop

for i in $(seq 1 $END); do echo $i; done
@kshcherban
kshcherban / ec2-root-resize.sh
Created November 13, 2018 14:28
ec2 root volume resize
#!/bin/bash -e
if [ $# -ne 2 ]; then
echo "Usage: $0 <instance-id> <volume-size-gb> [PARITION_NAME=/dev/xvda2]"
exit 2
fi
INSTANCE="$1"
VOLUME_SIZE="$2"
PARTITION="${3:-/dev/xvda2}"
@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 September 4, 2025 07:11
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" />