Skip to content

Instantly share code, notes, and snippets.

View xenjke's full-sized avatar

Andrey Shulzhenko xenjke

  • Kaluza
  • London
View GitHub Profile
#!/bin/bash
set -eux
declare GITHUB_TOKEN=''
declare TEST_PATH='bddly/quality-engineering'
declare TARGET_ENVIRONMENT='oea-test'
declare EXPECTED_STATUS='completed'
declare EXPECTED_CONCLUSION='success'
declare TIME_BETWEEN_API_CALLS=5

Candidate README

You are given the following text:

lorem ipsum dolor sit amet consectetur lorem ipsum et mihi quoniam et adipiscing elit.sed quoniam et advesperascit et mihi ad villam revertendum est nunc quidem hactenus ex rebus enim timiditas non ex vocabulis nascitur.nummus in croesi divitiis obscuratur pars est tamen divitiarum.nam quibus rebus efficiuntur voluptates eae non sunt in potestate sapientis.hoc mihi cum tuo fratre convenit.qui ita affectus beatum esse numquam probabis duo reges constructio interrete.de hominibus dici non necesse est.eam si varietatem diceres intellegerem ut etiam non dicente te intellego parvi enim primo ortu sic iacent tamquam omnino sine animo sint.ea possunt paria non esse.quamquam tu hanc copiosiorem etiam soles dicere.de quibus cupio scire quid sentias.universa enim illorum ratione cum tota vestra confligendum puto.ut nemo dubitet eorum omnia officia quo spectare quid sequi quid fugere debeant nunc vero a primo quidem mirabiliter occulta natura est nec perspici nec

@xenjke
xenjke / torrserv_install.sh
Created December 13, 2021 17:07
TorrServ setup on Ubuntu (Lightsail)
wget https://github.com/YouROK/TorrServer/releases/download/MatriX.109/TorrServer-linux-amd64
sudo mkdir --parent /opt/torrserver; sudo mv TorrServer-linux-amd64 $_
sudo apt -qq update
sudo apt install systemd-container -qq
sudo cat >> /etc/systemd/system/torrserver.service <<'EOF'
[Unit]
Description=torrserver
After=network.target
# first lets get the brew sorted
# that will ask for sudo going further
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# install commandline apps first then
# will prompt to install xcode extensions as well
# that will take time
brew install \
zsh \
fzf \
@xenjke
xenjke / realisation.rb
Created May 2, 2017 08:13
Find possible palindromes
# https://www.careercup.com/page?pid=amazon-interview-questions&job=quality-assurance-engineer-interview-questions
# "aabcbcbdcc" you can remove and shuffle characters, find the maximum length of string which forms palindrome.
# like "ccabdbacc"
cases = [
'zmasa3asesa'
]
def test_my_realisation(cases)
cases.each do |string|
@xenjke
xenjke / realisation.rb
Created April 30, 2017 11:04
Write a program to reverse string
require 'benchmark'
cases = [
'Word',
'Simple sentance',
'A one letter contatining sentance',
'Cover the punctuation!',
'',
'Digits h3r3 and 4there'
]
@xenjke
xenjke / realisation.rb
Last active April 30, 2017 08:22
Merge two sorted arrays without sorting and merging
require 'benchmark'
class Array
def insert_sorted(obj)
shift = -1
puts "Prepending #{obj} to #{self}"
if self.size == 0
puts "Adding #{obj} to the end of #{self}"
self << obj
puts "Got #{self}"
@xenjke
xenjke / spec_helper.rb
Created January 20, 2017 08:25
RSpec Slack reporter/listener
require_relative 'spec_reporter'
RSpec.configure do |config|
#custom listener
if ENV['REPORT'] == 'slack'
config.reporter.register_listener Listener.new, :start, :example_started, :example_passed, :example_failed, :dump_summary
end
end
@xenjke
xenjke / spec_helper.rb
Created January 20, 2017 08:21
RSpec JSON schema matcher
RSpec::Matchers.define :match_response_schema do |schema|
errors = []
schema_directory = "#{Dir.pwd}/spec/support"
schema_path = "#{schema_directory}/#{schema}.json"
match do |request|
errors << JSON::Validator.fully_validate(schema_path, request.response, strict: false)
errors.flatten!.empty?
end
failure_message do |request|
@xenjke
xenjke / .rubocop.yml
Created January 20, 2017 08:20
Some rubocop settings
SpaceAroundEqualsInParameterDefault:
Enabled: false
Metrics/LineLength:
Max: 140
Metrics/MethodLength:
Max: 20
Metrics/AbcSize: