Skip to content

Instantly share code, notes, and snippets.

View stepanselyuk's full-sized avatar

Stepan Seliuk stepanselyuk

View GitHub Profile
@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';
@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
*/
#!/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
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):
@stepanselyuk
stepanselyuk / API Vevo
Last active August 29, 2015 14:22 — forked from NTag/API Vevo
239.255.255.250
http://9cf9.v.fwmrm.net
http://api.twitter.com/1.1/
http://api.twitter.com/oauth/access_token
http://api.twitter.com/oauth/authenticate
http://api.twitter.com/oauth/authorize
http://api.twitter.com/oauth/request_token
http://api.vevo.com/mobile/v1/
http://api.vevo.com/mobile/v1/artist/
http://api.vevo.com/mobile/v1/artist/list.json?
@stepanselyuk
stepanselyuk / ConsoleAppHelper.php
Created January 19, 2015 20:28
ConsoleAppHelper
<?php
/**
* Created by PhpStorm.
* Author: Stepan Seliuk <stepan@selyuk.com>
* Date: 04/09/14
* Time: 22:22
*/
namespace app\components;
@stepanselyuk
stepanselyuk / AppThreadTrait.php
Created September 1, 2014 13:44
AppThread Trait
<?php
/**
* Created by PhpStorm.
* Author: Stepan Seliuk <stepan@selyuk.com>
* Date: 01/06/14
* Time: 15:46
*/
namespace app\components\traits;
@stepanselyuk
stepanselyuk / en-US.messages.js
Created September 1, 2014 13:26
Resources JSON and JS
if ( typeof window.MyApp === 'undefined' ) window.MyApp = {};
MyApp.ttData = {"params":{"lang":"en-US","source_lang":"ru-RU","currency":"EUR"},"messages":{"\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0441\u0442\u0440\u043e\u043a\u0443.":"You should select a one row.","\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c {a} \u0441\u0442\u0440\u043e\u043a\u0443.":"You should select {a} row."}};
@stepanselyuk
stepanselyuk / JavaScriptMessages.php
Created September 1, 2014 13:21
Component for generating JS-files for include in page
<?php
/**
* Created by PhpStorm.
* Author: Stepan Seliuk <stepan@selyuk.com>
* Date: 30/08/14
* Time: 22:33
*/
namespace app\components\i18n;
@stepanselyuk
stepanselyuk / JsTranslationsController.php
Created September 1, 2014 13:19
Collect strings for translation from *.js files Generate JSON resources
<?php
/**
* Created by PhpStorm.
* Author: Stepan Seliuk <stepan@selyuk.com>
* Date: 30/08/14
* Time: 20:29
*/
namespace app\commands\system;