Skip to content

Instantly share code, notes, and snippets.

View cheapmon's full-sized avatar
🏠
Working from home

Simon Kaleschke cheapmon

🏠
Working from home
View GitHub Profile
@cheapmon
cheapmon / code_that_i_hate.rb
Last active June 9, 2024 10:19
Ruby Unconf 2024 Refactoring Session
# frozen_string_literal: true
# Turn this: https://www.youtube.com/watch?v=dQw4w9WgXcQ
# Into this: https://www.youtube.com/embed/dQw4w9WgXcQ
#
# VIMEO is here too, I guess
module VideoUrlHelper
require "cgi"
YOUTUBE_EMBED_URL = "https://www.youtube.com/embed/"
@cheapmon
cheapmon / cassidoo-2024-06-03.rb
Created June 6, 2024 08:19
Casidoo: 2024-06-03
# Write a function that takes an array of integers and returns a new array containing only the even numbers, and sorted.
def only_evens(array)
array.select(&:even?).sort
end