emptygif
Language: English

All languages and frameworks

Ruby one-liner Ruby

A Ruby snippet for Ruby one-liner that answers requests for /pixel.gif with the empty GIF, decoded once at startup.

Ruby one-liner Ruby

File
pixel.sh
# unpack1("m") is core Ruby base64 decoding - no require needed.
ruby -e 'File.binwrite("pixel.gif", "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==".unpack1("m"))'

We ran this snippet and compared the bytes it returned.

Official site: Ruby one-liner

More in Ruby