Skip to content

Instantly share code, notes, and snippets.

@Cyan101
Last active October 25, 2016 13:34
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 Cyan101/c6bd12ca36b39179bdd59a587a2fd0d7 to your computer and use it in GitHub Desktop.
Save Cyan101/c6bd12ca36b39179bdd59a587a2fd0d7 to your computer and use it in GitHub Desktop.
Custom parser for http://github.com/Z64
require 'htmlentities'
coder = HTMLEntities.new
puts "Pack name please"
packname = gets.chomp
template = ["---\n", "expansion: #{packname}\n", "authors:\n", "- CAH\n", "- Cyan101\n", "questions:\n"]
loop do
puts "Saved file name"
filename = gets.chomp
break if File.exist?(filename)
filename = (filename + ".yaml")
break if File.exist?(filename)
puts "Couldn't find the file, please try again"
redo
end
toconvert = File.readlines(filename)
space = toconvert.index("\n")
toconvert.each_with_index do |x, i|
toconvert[i] = x.include?(':') ? ("- '#{x.chomp}'\n") : ("- #{x.chomp}\n")
end
toconvert[space] = "answers:\n"
out = template.join("") + toconvert.join("")
File.open(filename, 'w') { |f| f.write(coder.decode(out)) }
A wise man said, "Everything is about sex. Except sex. Sex is about _."
Our relationship is strictly professional. Let's not complicate things with _.
Corruption. Betrayal. _. Coming soon to Netflix, "House of _."
Because you enjoyed _, we thought you'd like _.
I can't believe Netflix is using _ to promote House of Cards.
We're not like other news organizations. Here at Slugline, we welcome _ in the office.
I'm not going to lie. I despise _. There, I said it.
Cancel all my meetings. We've got a situation with _ that requires my immediate attention.
If you need him to, Remy Danton can pull some strings and get you _, but it'll cost you.
Forcing a handjob on a dying man.
A homoerotic subplot.
An origami swan that's some kind of symbol?
25 shitty jokes about House of Cards.
My constituents.
Punching a congressman in the face.
Strangling a dog to make a point to the audience.
A childless marriage.
A much younger woman.
An older man.
Getting eaten out while on the phone with Dad.
Making it look like a suicide.
Carbon monoxide poisoning.
Discharging a firearm in a residential area.
Ribs so good they transcend race and class.
The sensitive European photographer who's fucking my wife.
Copy link

ghost commented Oct 22, 2016

why didn't you use an existing markdown converter like I did? did i miss some manual processing I should have done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment