Skip to content

Instantly share code, notes, and snippets.

@leeky
Created April 22, 2015 13:31
Show Gist options
  • Select an option

  • Save leeky/6cd3f3692c365865d35d to your computer and use it in GitHub Desktop.

Select an option

Save leeky/6cd3f3692c365865d35d to your computer and use it in GitHub Desktop.

Revisions

  1. leeky created this gist Apr 22, 2015.
    3 changes: 3 additions & 0 deletions gistfile1.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    require 'base64'

    File.open('./outfile.txt','w') {|f| f.write "data:image/png;base64," + Base64.strict_encode64(File.read('./input.png'))}