Skip to content

Instantly share code, notes, and snippets.

@jfahrenkrug
Created January 28, 2009 14:14
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 jfahrenkrug/53962 to your computer and use it in GitHub Desktop.
Save jfahrenkrug/53962 to your computer and use it in GitHub Desktop.
require 'base64'
contents = IO.read('/Users/johannes/Code/opensocial/images/screenshot.png')
data = Base64.encode64(contents)
puts %{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<img src="data:image/png;base64,#{data}"/>
</body>
</html>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment