Skip to content

Instantly share code, notes, and snippets.

@vschiavoni

vschiavoni/a.rb Secret

Created February 12, 2016 21:35
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 vschiavoni/344d76a34914bcff22f6 to your computer and use it in GitHub Desktop.
Save vschiavoni/344d76a34914bcff22f6 to your computer and use it in GitHub Desktop.
nodes = ""
# for each node on the list tl
tl.each do |n|
nodes << n.to_s << ','
end
if nodes.size > 0
nodes = nodes[0, nodes.length - 1]
end
# add the string into the main "timeline" string
timelines << %Q({"time":"#{t}","nodes":[") << nodes << %Q(]"},"
nodes = ""
# for each node on the list tl
tl.each do |n|
nodes = nodes + n.to_s + ','
end
if nodes.size > 0
nodes = nodes[0, nodes.length - 1]
end
# add the string into the main "timeline" string
timelines = timelines + '{"time":' + t.to_s + ',"nodes":[' + nodes + ']},'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment