Skip to content

Instantly share code, notes, and snippets.

@moro
Created February 10, 2011 08:37
Show Gist options
  • Save moro/820146 to your computer and use it in GitHub Desktop.
Save moro/820146 to your computer and use it in GitHub Desktop.
#!/Users/moro/opt/ruby192/bin/ruby
magicome = "# coding: #{Encoding.default_external.to_s.downcase}"
ARGV.each do |fname|
File.open(fname, 'r+:BINARY') do |src|
content = src.read
src.rewind
src.puts magicome
src.write content
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment