Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created August 22, 2015 13:27
Show Gist options
  • Save anonymous/7d9047b357c040d8bdde to your computer and use it in GitHub Desktop.
Save anonymous/7d9047b357c040d8bdde to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
require "cgi"
require "erb"
cgi = CGI.new
fObj = cgi.params["upfile"][0]
hlfile = File.new("hypergraph.hl", "w")
hlfile.puts(fObj.read)
hlfile.close
@a = %x{hypergraph -ol hypergraph.hl}
tmpl = File.read("../uploaded.html")
out = ERB.new(tmpl)
print "Content-type: text/html\n\n"
print out.result()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment