$ 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./miniruby -e 'use_symbol = Object.instance_methods[0].is_a?(Symbol) | |
nummodule = nummethod = 0 | |
mods = [] | |
ObjectSpace.each_object(Module) {|m| mods << m if m.name } | |
mods = mods.sort_by {|m| m.name } | |
mods.each {|mod| | |
nummodule += 1 | |
mc = mod.kind_of?(Class) ? "class" : "module" | |
puts "#{mc} #{mod.name} #{(mod.ancestors - [mod]).inspect}" | |
mod.singleton_methods(false).sort.each {|methname| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> | |
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/spiermar/d3-flame-graph@2.0.3/dist/d3-flamegraph.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html><head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js"></script><meta charset="utf-8" /> | |
<!-- generated by ansi-to-html 0.0.3 https://github.com/uu59/ansi-to-html --> | |
</head><body style="color:#fff;background-color:#000"> | |
<pre> | |
{"* malloc_info gen statistics"=>[["0", "29575", "12037320"], ["1", "16031", "2734752"], ["2", "910", "5874816"], ["3", "308", "5510752"], ["4", "8", "15440"], ["5", "12", "116848"], ["6", "4", "1312"], ["7", "177", "5559128"], ["8", "103", "59848"], ["9", "8", "768"], ["10", "15", "1288"], ["11", "11", "1080"], ["12", "14", "4496"], ["13", "18", "30400"], ["14", "1", "72"], ["15", "1", "120"], ["16", "30", "232976"], ["17", "7", "504"], ["18", "0", "0"], ["19", "18", "2224"], ["20", "0", "0"], ["21", "17", "18080"], ["22", "0", "0"], ["23", "0", "0"], ["24", "0", "0"], ["25", "0", "0"], ["26", "0", "0"], ["27", "0", "0"], ["28", "0", "0"], ["29", "0", "0"], ["30", "0", "0"], ["31", "0", "0"], ["32", "0", "0"], ["33", "0", "0"], ["34", "0", "0 |
A "cookable" program written in Chef. Inspired by Hello World Cake with Chocolate sauce. I actually cooked it: Cookpad (en) / Cookpad (ja).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
M1 k1 = (call/cc (M2 k1)) + 3 | |
M2 k1 k2 = if b then (k1 1) else (k2 2) | |
(call/cc M1) + 4 | |
S1 k1 = (shift (λk2. k2 (S2 k1 k2))) + 3 | |
S2 k1 k2 = if b then (k1 1) else (k2 2) | |
reset(exit(shift (λk1. k1 (S1 k1)) + 4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
class MemberClass | |
def initialize(a, b, c, d, e, f, g) | |
@a = a | |
@b = b | |
@c = c | |
@d = d | |
@e = e | |
@f = f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval(v=%(eval((e=*%w'662c3d220 | |
214450800010840000001108420800 | |
2084211000024cf324000000011c40 | |
114a5288001184211c003242643c00 | |
788c1498001194f108007a1c149800 | |
321c9498007 844221000324c94980 | |
032527098000 01e0780004a5e94a | |
400000e949c0 0421c94b8000006 | |
420c00084e94 9c00000cb618001 | |
148e21000421 2e4 a400308421 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval(v=%(eval((e=*%w'662c3d220 | |
214450800010840000001108420800 | |
2084211000024cf324000000011c40 | |
114a5288001184211c003242643c00 | |
788c1498001194f108007a1c149800 | |
321c9498007844221000324c949800 | |
3252709800001e0780004a5e94a400 | |
000e949c00421c94b8000006420c00 | |
084e949c00000cb618001148e21000 | |
4212e4a4003084211c00001c972100 |
NewerOlder