Skip to content

Instantly share code, notes, and snippets.

View mame's full-sized avatar

Yusuke Endoh mame

View GitHub Profile
@mame
mame / dev-meeting-agenda-setup.rb
Last active May 14, 2021 00:09
A script to create an agenda for dev-meeting https://bugs.ruby-lang.org/issues/14770
#!/usr/bin/env ruby
require "open-uri"
require "json"
unless ARGV[0] =~ %r{\Ahttps://bugs.ruby-lang.org/issues/(\d+)\z}
puts "Usage: #$0 https://bugs.ruby-lang.org/issues/XXXX"
exit 1
end
@mame
mame / README.md
Last active September 11, 2021 10:23
@mame
mame / README.md
Created September 28, 2022 14:35
A non-trivial quine written in Liquid markup language
$ gem install liquid

$ ruby -rliquid -e 'puts Liquid::Template.parse($<.read).render' quine.liquid
{%assign a="{Passign a=QZQ|split:QQP}{Pfor c in aP}{Pif c == a[12]P}{{a}}{Pelsif c == a[1]P}P{Pelsif c == a[11]P}Q{PelseP}{{c}}{PendifP}{PendforP}"|split:""%}{%for c in a%}{%if c == a[12]%}{{a}}{%elsif c == a[1]%}%{%elsif c == a[11]%}"{%else%}{{c}}{%endif%}{%endfor%}

$ diff -s quine.liquid <(ruby -rliquid -e 'puts Liquid::Template.parse($<.read).render' quine.liquid)
Files quine.liquid and /dev/fd/63 are identical