Skip to content

Instantly share code, notes, and snippets.

@gerep
Forked from scalone/cut_the_hope.rb
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerep/1372466556fb6cb45fa9 to your computer and use it in GitHub Desktop.
Save gerep/1372466556fb6cb45fa9 to your computer and use it in GitHub Desktop.
f = IO.binread("avatar.gif")
@parts = []
f.each_char.each_slice(10000).each do |s|
@parts << s.join
end
@text = ""
@parts.each { |chunk| @text << chunk }
IO.write("avatar2.gif", @text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment