Skip to content

Instantly share code, notes, and snippets.

View Drowze's full-sized avatar

R Gibim Drowze

View GitHub Profile
@Drowze
Drowze / .irbrc
Last active September 4, 2024 16:51
My .irbrc - with some hacks here and there; definitely not something you'd want in a production environment!
# frozen_string_literal: true
# rubocop:disable Style/Documentation
IRB.conf[:SAVE_HISTORY] = 10_000
alias r require
%w[json securerandom yaml pp pry pry-byebug redis zlib base64].each do |lib|
r lib
rescue LoadError
@Drowze
Drowze / README.md
Last active October 11, 2024 13:13
Useful OpenAPI notes and ideas
  • Linting an open api description

    npx @redocly/cli lint swagger/openapi.json
  • Generating doc hmtl page for the description

npx @redocly/cli build-docs swagger/openapi.json

@Drowze
Drowze / .pryrc
Created October 18, 2024 18:20
Avoid overwriting irb history with pry (when opening a pry session inside an existing irb session)
require 'readline'
def __flush_history
Readline::HISTORY.slice!(0..-1)
end
def __restore_history(irb_history)
__flush_history
irb_history.each { |line| Readline::HISTORY << line }
end
@Drowze
Drowze / settings.rb
Created March 20, 2025 15:42
Using dry-configurable to store app settings.
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'dry-configurable'
end
require "singleton"
class Settings
@Drowze
Drowze / Generating the SDK.md
Created April 18, 2025 13:53
Using Zitadel with Ruby (gRPC)

With buf.gen.yaml as:

version: v2
plugins:
  - remote: buf.build/grpc/ruby:v1.71.0
    out: gen
    include_imports: true
  - remote: buf.build/protocolbuffers/ruby:v30.2
    out: gen