Skip to content

Instantly share code, notes, and snippets.

@ChrisZou
Created September 11, 2020 16:10
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 ChrisZou/7e40361c6b9c704d2da2f718531dcb8f to your computer and use it in GitHub Desktop.
Save ChrisZou/7e40361c6b9c704d2da2f718531dcb8f to your computer and use it in GitHub Desktop.
One-line Ruby to preview all svg files in a dir
Dir["*.svg"].map { "<img src='./#{_1}' style='width: 100px; height: 100px; margin: 20px' /> " }.join("\n").then { File.write("result.html", _1); system("open result.html") }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment