Skip to content

Instantly share code, notes, and snippets.

@Hakier
Hakier / rsync-preserve-dirs-structure.sh
Created January 16, 2023 07:21
Rsync: backup only specified files and preserve relative paths without a parent directory
#!/usr/bin/env bash
#setup
mkdir -p playground/{source,target} && cd playground
mkdir -p source/{a,b,c}/{d,e,f}/{g,h,i}
touch source/{.,a,b/{e,f},c/d/{g,h,i}}/{1,2,3,4,5}
#first sync
cd source && rsync -aR 3 a/ b/f/ c/d ../target/ --delete && cd -
find -type f
@Hakier
Hakier / AliorBank-preventLogoutLoop.js
Created December 8, 2021 18:01
AliorBank-preventLogoutLoop.js
class ExchangeOfficeApp {
static refreshSession() {
[...document.querySelectorAll('.button')]
.filter(el => el.innerText === 'Odśwież sesję')
.forEach(el => el.click());
}
static preventLogoutLoop() {
ExchangeOfficeApp.refreshSession();
setTimeout(ExchangeOfficeApp.preventLogoutLoop, 15_000);
@Hakier
Hakier / README.md
Last active October 4, 2023 16:37
install-google-chrome.sh

How to install Google Chrome on Debian-based Linux

To install a stable version you can call any of the fallowing commands:

curl -o- https://gist.githubusercontent.com/Hakier/7c7a11c33d62a4502409382e8eaa8051/raw/install-google-chrome.sh | bash
wget -qO- https://gist.githubusercontent.com/Hakier/7c7a11c33d62a4502409382e8eaa8051/raw/install-google-chrome.sh | bash
@Hakier
Hakier / structural-directive.spec.ts
Created March 10, 2019 08:41
How to get an instance of structural directive to properly test if some value has been passed to it?
import { Component, Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
const showReflection: any = {};
@Directive({ selector: '[appShow]' })
export class UnlessDirective {
constructor(
private templateRef: TemplateRef<any>,