Skip to content

Instantly share code, notes, and snippets.

View stepanselyuk's full-sized avatar

Stepan Seliuk stepanselyuk

View GitHub Profile
import inotify.adapters
import yaml
import os.path
import time
def _main():
i = inotify.adapters.InotifyTree('/tmp')
for event in i.event_gen(yield_nones=False):
#!/usr/bin/env bash
# CF API KEY
# API key != TOKEN (Certbot 1.11 which installed by Jenkins X expects API key)
API_KEY="KEY_HERE"
cat <<EOF | kubectl -n jx apply -f -
---
apiVersion: v1
kind: Secret
@stepanselyuk
stepanselyuk / LRUCache.Clean.php
Created February 12, 2021 08:22
LRUCache Leetcode (Medium, #146)
<?php
include_once '../../runner.php';
class DoublyLinkedList
{
/**
* @var DoublyLinkedListNode|null
*/
@stepanselyuk
stepanselyuk / LFUCache.php
Created February 12, 2021 08:26
LFUCache Leetcode (Hard, #460)
<?php
/*
* Least Frequently Used (LFU) is a caching algorithm in which the least frequently used cache block is removed whenever the cache is overflowed.
* In LFU we check the old page as well as the frequency of that page and if the frequency of the page is larger than the old page we cannot remove it
* and if all the old pages are having same frequency then take last i.e FIFO method for that and remove that page.
*/
include_once '../../runner.php';