Skip to content

Instantly share code, notes, and snippets.

View lisovskyvlad's full-sized avatar

Lisovskii Vladislav lisovskyvlad

View GitHub Profile
@lisovskyvlad
lisovskyvlad / SketchSystems.spec
Last active February 24, 2020 22:34
Password reset flow*
Password reset flow*
Login Form Page
forgot-password -> Forgot Password Page
Forgot Password Page
Disabled submit button*
entering-valid-email -> Green submit button
Green submit button
submit -> Success - Resend Email Page
got-email -> Enter new pasword Page
const counterIncrement = (collector, char) => {
const lastItemIndex = collector.length - 1;
if(lastItemIndex === -1) {
return [[char, 1]];
}
if(collector[lastItemIndex][0] == char) {
collector[lastItemIndex][1] += 1
} else {
@lisovskyvlad
lisovskyvlad / promise_playground.js
Created March 18, 2019 17:49
Learning of promises
const f = (wait_count, string) => (
new Promise((res, rej) => (setTimeout(() => res(string), wait_count)))
);
async function sequence() {
const a = await Promise.all([
f(2000, '2000 wait'),
f(500, '500 wait'),
f(1000, '1000 wait')
]);
@lisovskyvlad
lisovskyvlad / titanic.json
Created February 11, 2019 11:30
Response from http://www.omdbapi.com/ for titanic
{
"Title": "Titanic",
"Year": "1997",
"Rated": "PG-13",
"Released": "19 Dec 1997",
"Runtime": "194 min",
"Genre": "Drama, Romance",
"Director": "James Cameron",
"Writer": "James Cameron",
"Actors": "Leonardo DiCaprio, Kate Winslet, Billy Zane, Kathy Bates",
{:user {:plugins [[lein-cljfmt "0.6.1"]]
:dependencies [[lein-light-nrepl "0.3.3"]]
:repl-options {:nrepl-middleware [lighttable.nrepl.handler/lighttable-ops]}}}
@lisovskyvlad
lisovskyvlad / middle_rate.rb
Last active July 29, 2018 08:15
Ruby solution for the task mentioned in the article http://grishaev.me/why-clj
class MiddleRate
attr_reader :data
def initialize(data)
@data = data
end
def call
# age rates got { 18 => [30, 15], 50 => [35] }
age_rates = data.each_with_object(memory_hash) do |data_item, acc|
FROM starefossen/ruby-node:2-8
LABEL maintainer="Lisovskii Vladislav (a@a.de)"
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
ENV APP_HOME /sw-app
RUN mkdir $APP_HOME
WORKDIR $APP_HOME
Running with gitlab-ci-multi-runner 9.5.1 (96b34cc)
on ci_runner_02 (bcf9d6e9)
Using Docker executor with image ruby:2.4.3 ...
Starting service postgres:latest ...
Pulling docker image postgres:latest ...
Using docker image postgres:latest ID=sha256:ec61d13c85666651ff092b89d46ae958d81c7f3d387ed91ae5c530a38b9896e2 for postgres service...
Waiting for services to be up and running...
Using docker image sha256:b8b3cb280f3e2b76afb91d3c7c3227bac6de27e9f27e7ace2d9dd533b9c92309 for predefined container...
Pulling docker image ruby:2.4.3 ...
Using docker image ruby:2.4.3 ID=sha256:713da53688a6446953cb7c0260d03a65a115cb60b727a890142628a4622642c7 for build container...
image: ruby:2.4.3
stages:
- test
services:
- postgres:latest
variables:
POSTGRES_DB: sw-test-db
class Trie
Node = Struct.new(:char, :children, :is_complete_word)
attr_reader :root
def initialize
@root = Node.new('', {}, false)
end
def add_word(word)