Skip to content

Instantly share code, notes, and snippets.

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
v-kolesnikov /
Created May 30, 2019 17:08 — forked from CMCDragonkai/
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 / coverage.rb
Created January 29, 2023 11:34
Coverage groups
View 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}
View .npmrc

Bookmate Tech Stack


Primary technologies

  • Ruby
  • Ruby on Rails (v.6 at 12/22)
  • Sidekiq
  • MySQL
View Fast SQL counting for UI
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 .
v-kolesnikov / app.rb
Created May 23, 2020 09:08
Single file Rails app
View app.rb
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source ''
gem 'rails', '~> 6.0'
require 'action_controller/railtie'
v-kolesnikov / Gemfile
Last active August 22, 2022 18:45
Asynchronous files downloader.
View Gemfile
# frozen_string_literal: true
source ""
gem 'down'
gem 'dry-monads'
gem 'http'
v-kolesnikov /
Created June 22, 2022 13:52 — forked from cmod/
Fast, instant client side search for Hugo static site generator

Super fast, keyboard-optimized, client side Hugo search

This is a fork of and builds upon the work of Eddie Webb's search and Matthew Daly's search explorations.

It's built for the Hugo static site generator, but could be adopted to function with any json index compatible with Fuse fuzzy search library.

To see it in action, go to and press CMD-/ and start typing.

Fast Search

v-kolesnikov / ll.rb
Created October 6, 2021 09:39
Gem licenses ruby
View ll.rb
text = do |name, spec|
"#{name};#{spec.licenses.join(', ')}"
puts text
v-kolesnikov / roda_pipeline.rb
Created June 30, 2021 23:12
Phoenix-like `pipeline` plugin for Roda
View roda_pipeline.rb
require 'bundler/inline'
gemfile(true) do
gem 'roda'
gem 'webrick'
class M1
def initialize(app)
@app = app