emptygif
Idioma: Español

Todos los lenguajes y frameworks

Ruby one-liner Ruby

Un fragmento en Ruby para Ruby one-liner que responde a las peticiones a /pixel.gif con el GIF vacío, decodificado una sola vez al arrancar.

Ruby one-liner Ruby

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

Ejecutamos este fragmento y comparamos los bytes que devolvió.

Sitio oficial: Ruby one-liner

Más en Ruby