Skip to content

Instantly share code, notes, and snippets.

View valeksiev's full-sized avatar

Vladimir Aleksiev valeksiev

View GitHub Profile
name = []
def set_name(self, user_name):
return len( - 1
def get_name(self, user_id):
if user_id >= len(
return 'There is no such user'
valeksiev / index.html
Last active April 13, 2021 15:26
forEach vs filter + concat vs filter + splat ( #jsbench #jsperf
<!DOCTYPE html>
<meta charset="utf-8"/>
<title>forEach vs filter + concat vs filter + splat</title>
<script src=""></script>
<script src="./suite.js"></script>
<h1>Open the console to view the results</h1>
=Clicking links and buttons=
click_link('Link Text')
click('Link Text') # Click either a link or a button
click('Button Value')
valeksiev / smaple_spec.rb
Last active November 17, 2015 14:11
A bit more extended sample spec for Ruby@FMI fifth task
describe ObjectStore do
RSpec::Matchers.define :be_success do |with_message: '', and_result: false|
match do |actual|
without_result = actual.message == with_message &&
actual.success? == true &&
actual.error? == false
return without_result unless and_result
valeksiev / sample_spec.rb
Last active October 23, 2015 13:32
A bit more extended sample spec for Ruby@FMI third task
require 'prime'
describe 'Third task' do
describe RationalSequence do
it 'can calculate the first rational number' do
expect( eq ['1/1'.to_r]