Skip to content

Instantly share code, notes, and snippets.

View svoop's full-sized avatar
🌍
Coders for future

Sven Schwyn svoop

🌍
Coders for future
View GitHub Profile
@svoop
svoop / examples.rb
Created March 16, 2025 09:47
Conditional assignment styles
# (1) if with assignment wide indent (original)
destination = if to.is_a?(URI)
to.to_s
elsif to.start_with?("http://") || to.start_with?("https://")
to
else
prefixed_path(to)
end
# (2) case with assignment wide indent
# All class methods (original)
# Usage: Mailjet::WebhookService::Event.all
module Mailjet
module WebhookService
class Base
class << self
def domain(prefix=nil)
end
@svoop
svoop / build-checkpoint
Created May 17, 2023 19:39
Build Checkpoint for Render
#!/usr/bin/env ruby
require 'bundler/inline'
require 'optparse'
require 'timeout'
gemfile do
source 'https://rubygems.org'
gem 'redis'
end