Skip to content

Instantly share code, notes, and snippets.

@cabb
cabb / svg_processing.rb
Created May 10, 2022 08:12 — forked from botanicus/svg_processing.rb
Change colours of a SVG image with Nokogiri.
#!/usr/bin/env ruby
# encoding: utf-8
require "nokogiri"
require "fileutils"
# setup
required_colors = ["ff000", "006600", "003399"]
# main
@cabb
cabb / authentication.rb
Created March 18, 2022 09:26 — forked from adhrinae/authentication.rb
Hanami User Authentication with session
# web/controllers/authentication.rb
module Web
module Authentication
module Skip
def authenticate!
end
end
def self.included(action)
action.class_eval do
@cabb
cabb / thread_pool.rb
Created October 6, 2021 15:25 — forked from ik5/thread_pool.rb
example on how to do threadpool in ruby
require 'thread'
queue = Queue.new
threads = []
1.step(1000) do |i|
queue << i
end
8.times do