Skip to content

Instantly share code, notes, and snippets.

View gazay's full-sized avatar
🌐

Alex Gaziev gazay

🌐
View GitHub Profile
#!/usr/bin/env ruby
require 'epath'
bom = "\xEF\xBB\xBF".force_encoding('binary')
Path.glob('**/*.rb') do |file|
next if file.binread(3) == bom
previous = file.binread
file.write bom + previous
end