Skip to content

Instantly share code, notes, and snippets.

View lexruee's full-sized avatar
👻
tinkering

Alexander Rüedlinger lexruee

👻
tinkering
View GitHub Profile
@lexruee
lexruee / gist:300ca4ee17d603e2989f9f16ca61f85a
Created June 30, 2019 19:06
Installing spotify on arch linux
gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 931FF8E79F0876134EDDBDCCA87FF9DF48BF1C90
yay -S spotify
@lexruee
lexruee / find_missing_letter.rb
Last active March 19, 2020 18:26
Find the missing letter in the passed letter range and return it.
def find_missing_letter(range)
chars = range.chars
max_char = chars.max
min_char = chars.min
missing_chars = (min_char..max_char).to_a - chars
missing_chars.first
end
p find_missing_letter "abde"
p find_missing_letter "abcdefgijk"
@lexruee
lexruee / diff_array.rb
Created March 19, 2020 19:00
Compare two arrays and return a new array with any items only found in one of the two given arrays, but not both.
def diff_array(first_array, second_array)
(first_array - second_array) + (second_array - first_array)
end