Skip to content

Instantly share code, notes, and snippets.

View v-kolesnikov's full-sized avatar
✍️
I'm writing something just now! You can write me too! 😉

Vasily Kolesnikov v-kolesnikov

✍️
I'm writing something just now! You can write me too! 😉
View GitHub Profile
CommonJS
ESM
AMD
ES modules
ES6 modules
mjs
import, export
script defer
@v-kolesnikov
v-kolesnikov / http_streaming.md
Created May 30, 2019 17:08 — forked from CMCDragonkai/http_streaming.md
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@v-kolesnikov
v-kolesnikov / index.md
Last active July 25, 2023 20:37
My CS conspects

CS Notes

Or what I would like to know clear (ясно).

  • bytes (despite I know bits quite well)
  • byte-strings
  • encodings
  • packing & unpacking bytes (Ruby Array#pack & String#unpack etc)

Bit

@v-kolesnikov
v-kolesnikov / uuid.rb
Created July 24, 2023 15:51 — forked from brandur/uuid.rb
UUID data type in Ruby
# typed: strict
# frozen_string_literal: true
require "base32"
require "securerandom"
require "ulid"
# A type to represent UUIDs. Particularly useful for annotating fields in API
# representations or Sorbet parameters to help prevent accidentally mixing up
# UUIDs and EIDs as they're being passed around as loose strings.
@v-kolesnikov
v-kolesnikov / Gemfile
Last active April 3, 2023 11:31
Asynchronous files downloader.
# frozen_string_literal: true
source "https://rubygems.org"
gem 'down'
gem 'dry-monads'
gem 'http'
@v-kolesnikov
v-kolesnikov / coverage.rb
Created January 29, 2023 11:34
Coverage groups
# https://github.com/jeremyevans/forme/blob/master/spec/forme_coverage.rb
require 'coverage'
require 'simplecov'
def SimpleCov.forme_coverage(opts = {})
start do
enable_coverage :branch
add_filter "/spec/"
add_group('Missing'){|src| src.covered_percent < 100}
add_group('Covered'){|src| src.covered_percent == 100}
audit=false
engine-strict=true
fund=false
legacy-peer-deps=false

Bookmate Tech Stack

Backend

Primary technologies

  • Ruby
  • Ruby on Rails (v.6 at 12/22)
  • Sidekiq
  • MySQL
opts[:max_dataset_size]
It is a very important constant that provides a useful performance optimization.
For example we have N records in `users` table and want to show that number
under the corresponding table on `/users` page. It would be quite fast for DB
to count some tausands records and return that value back to the application.
But in case of 1M records the same task will load the DB server significantly
and without the relevant reason. There is no difference for web-app purposes
whether we have 1M or 1M+1 records in the DB .