This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module A | |
def foo | |
"A" | |
end | |
end | |
module Z | |
include A | |
def foo | |
"Z" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# © 2025 Konstantin Gredeskoul, All rights reserved. | |
# | |
# This script is a proof of concept to show how to use ActiveSupport::Concern | |
# to manage dependencies between modules and classes. The main idea is to use | |
# the included block to include the dependencies of a module, and the | |
# class_methods block to define class methods. | |
# | |
# Ultimately, the script prints all of the the methods of the Host, Bar, and | |
# Foo classes and modules to show the result of the concern implementation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# vim: ft=bash | |
# | |
# © 2025 Konstantin Gredeskoul | |
# http://github.com/kigster | https://kig.re | |
# | |
# This script allows you to export the list of your VSCode | |
# extensions and import them into, eg. Cursor IDE. Or the | |
# other way around. By the default the script continues on | |
# import errors because there are typically quite a few. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# vim: ft=bash | |
# Uses sysbench on Ubuntu to run CPU, RAM and File IO Tests | |
# Saves the output into "result-for-<instance-type>-<date>-<time>.txt | |
# | |
# You can run this as follows without downloading: | |
# curl -fsSL https://gist.githubusercontent.com/kigster/3869409f17739461f9d1fb7e0aa5022c/raw | bash | |
line() { | |
echo -e "\e[0;33m———————————————————————————————————————————————————————————————————————\e[0m" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# vim: ft=bash | |
# | |
# © 2025 Konstantin Gredeskoul <kig AT kig.re> | |
# All rights reserved. | |
# MIT License. | |
# | |
# This script uses rbenv/ruby-build to install Ruby on OS-X or Linux. It configures | |
# Ruby build flags in such a way to ensure Ruby is linked with libjemalloc (which | |
# reduces the memory by half) and YJIT enabled. It has been tested on both Linux and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# vim: ft=bash | |
# | |
# © 2024 Konstantin Gredeskoul <kig AT kig.re> | |
# | |
# How to use this: | |
# curl -fsSL https://bit.ly/rb-jemalloc-check | bash | |
export rc=/tmp/ruby-check | |
curl -fsSL -o $rc "https://raw.githubusercontent.com/kigster/bashmatic/refs/heads/main/bin/ruby-check" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# vim: ft=bash | |
# | |
# This Gist is about installing any version of Ruby using rbenv on Linux or MacOS | |
# with Jemalloc and YJIT enabled. | |
# | |
# To install a ruby run the following command (this will install the ruby version | |
# defined in the .ruby-version file in the current directory) | |
# | |
# curl -fsSL https://bit.ly/rb-rbenv-install | bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (c) 2024 Konstantin Gredeskoul | |
# Under the MIT License | |
# | |
# This gist documents a frequently thed pattern of decorating multiple classes with Logging methods | |
# by sharing just one Logger typically at the top of the module namespace (Application) in this case. | |
# If the concurrency issues come up, each class can be given its own logger, or perhaps the Logging moduloe | |
# might have decorators for each of the logging methods (eg #info, #debug) by using a Mutex. | |
# | |
# The output of this Ruby Code should be as follows: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile | |
source "https://rubygems.org" | |
# Activate the gem you are reporting the issue against. | |
gem 'rails', '>= 7.0.4.3' | |
gem "dalli" | |
gem "rspec" | |
gem "rspec-its" | |
gem "rspec-rails" | |
gem "awesome_print" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This file requires a local SQL file named "json_table_columns.csv" to have two columns: | |
-- [ "Table", "Column" ] | |
-- It then loops over records in this table computing the total size of the column in each table, | |
-- the average size of the column in that table, and finally the percentage that column occupies relative | |
-- to the entire table (including its indexes). | |
-- First we import the data | |
BEGIN; | |
drop table if exists JSON_TABLE_COLUMNS; |
NewerOlder