Skip to content

Instantly share code, notes, and snippets.

# frozen_string_literal: true
# gem install benchmark-memory
# gem install benchmark-ips
require 'benchmark/ips'
require 'benchmark/memory'
require 'active_support/all'
TIMES = 50_000
@doha99-eh
doha99-eh / hash_with_indifferent_access_benchmark.rb
Created April 28, 2023 08:25 — forked from tiagoamaro/hash_with_indifferent_access_benchmark.rb
ActiveSupport's HashWithIndifferentAccess access benchmark vs common Ruby Hash
#####################
# Ruby Version: 2.1.6
#####################
# gem 'activesupport', '=3.2.22'
# gem 'activesupport', '=4.2.5'
require 'active_support/all'
require 'benchmark/ips'
@doha99-eh
doha99-eh / Gemfile
Last active October 26, 2022 10:16 — forked from janko/Gemfile
Memory profiling of http.rb and other popular Ruby HTTP client libraries
source "https://rubygems.org"
gem "roda"
gem "http", "~> 3.3"
gem "rest-client"
gem "httparty"
@doha99-eh
doha99-eh / ubuntu-dock-icons-center.md
Created November 14, 2021 01:24
Make Ubuntu dock icons centered

To bring dock to the bottom

$ gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM

To bring dock to the center

$ gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false

copy from https://askubuntu.com/a/1366908/1426831

@doha99-eh
doha99-eh / docker-compose.yml
Created September 22, 2021 07:24
kafdrop / docker-compose.yml
version: "2"
services:
kafdrop:
image: obsidiandynamics/kafdrop
ports:
- "9000:9000"
environment:
KAFKA_BROKERCONNECT: "kafka:29092"
JVM_OPTS: "-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
depends_on:
@doha99-eh
doha99-eh / clean_code.md
Created June 15, 2021 06:58 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@doha99-eh
doha99-eh / keybase.md
Created August 23, 2020 15:05
keybase.md

Keybase proof

I hereby claim:

  • I am doha99-eh on github.
  • I am doha99 (https://keybase.io/doha99) on keybase.
  • I have a public key ASDXnArugJuXosnhnLecKPfLfrKDFaRZ5jP0INDOSKHXMQo

To claim this, I am signing this object:

@doha99-eh
doha99-eh / Gemfile
Created June 25, 2020 05:21 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@doha99-eh
doha99-eh / GIT_BLAME_DELETED.md
Created January 14, 2020 06:43 — forked from rpdelaney/GIT_BLAME_DELETED.md
git blame for deleted lines

git blame can tell you who last changed a file line by line. But how can you find out who deleted a line?

You can pseudo-git-blame a deleted line using either of the following, depending on whether you want to do a simple string matching search or use a regex:

  1. git log -S [string] ./file
  2. git log -G [regex] ./file