Skip to content

Instantly share code, notes, and snippets.

@nejdetkadir
Created August 8, 2021 15:04
Show Gist options
  • Save nejdetkadir/f82b18b26cdfcb012a1138d08e8eca07 to your computer and use it in GitHub Desktop.
Save nejdetkadir/f82b18b26cdfcb012a1138d08e8eca07 to your computer and use it in GitHub Desktop.
How to generate qrcode with Ruby
require "rqrcode"
qrcode = RQRCode::QRCode.new("http://github.com/")
# NOTE: showing with default options specified explicitly
svg = qrcode.as_svg(
color: "000",
shape_rendering: "crispEdges",
module_size: 11,
standalone: true,
use_path: true
)
IO.binwrite("./github-qrcode.svg", svg.to_s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment