Skip to content

Instantly share code, notes, and snippets.

View DimaSamodurov's full-sized avatar
🇺🇦
Stand With Ukraine

Dmytro Samodurov DimaSamodurov

🇺🇦
Stand With Ukraine
  • EPAM
  • Lviv, Ukraine
View GitHub Profile
@DimaSamodurov
DimaSamodurov / test_gc.rb
Created June 11, 2023 23:01
measuring Ruby GC
require 'benchmark'
def show_memory_consumption
puts `pmap #{Process.pid} | tail -n 1`
end
#GC.disable
result = Benchmark.measure do
200.times { |i|
"a"*100_000_000
@DimaSamodurov
DimaSamodurov / .sqlfluff
Last active May 24, 2024 13:38
Linter configs
[sqlfluff]
dialect = clickhouse
templater = jinja
sql_file_exts = .sql,.sql.j2,.dml,.ddl
max_line_length = 140
; exclude CO03 capitalisation.functions as sqlfluff does not have camelCase option used by ClickHouse.
; https://docs.sqlfluff.com/en/stable/rules.html#rule-CP03
; exclude LT01 layout.spacing as it removes space alignment and adds space to `Nullable ()` call in some cases.
@DimaSamodurov
DimaSamodurov / colorize.rb
Last active September 17, 2024 14:43
List nested branches down to the master branch based on PR sequence (using GitHub command line)
module Colors
RED = 31
GREEN = 32
YELLOW = 33
BLUE = 34
end
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"