-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.rb
More file actions
43 lines (34 loc) · 787 Bytes
/
code.rb
File metadata and controls
43 lines (34 loc) · 787 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# require 'rqrcode_core'
# qr = RQRCodeCore::QRCode.new('', size: 4, level: :h)
# puts qr.to_s
#
# require 'rqrcode_core'
#
# qr = RQRCodeCore::QRCode.new('--your link here--', size: 5, level: :h, mode: :kanji)
# qr.modules.each do |row|
# row.each do |col|
# print col ? '#' : ' '
# end
#
# print "\n"
# end
require 'rqrcode'
require 'launchy'
def yay
qrcode = RQRCode::QRCode.new("--Your QR Content Here--")
png = qrcode.as_png(
bit_depth: 1,
border_modules: 4,
color_mode: ChunkyPNG::COLOR_GRAYSCALE,
color: 'black',
file: nil,
fill: 'white',
module_px_size: 10,
resize_exactly_to: false,
resize_gte_to: false,
size: 160
)
IO.write("/tmp/github-qrcode.png", png.to_s)
Launchy.open("/tmp/github-qrcode.png")
end
yay