This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |