Skip to content

Instantly share code, notes, and snippets.

@stevenwilkin
Created February 28, 2010 15:01
Show Gist options
  • Save stevenwilkin/317620 to your computer and use it in GitHub Desktop.
Save stevenwilkin/317620 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
# html_encode.rb
# convert commandline input to html entities
$*.join(' ').each_char {|c| print "&##{c[0]};"}
puts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment