Skip to content

Instantly share code, notes, and snippets.

Avatar

Yusuke Endoh mame

View GitHub Profile
View main.rb
eval x=%q;
# A quine for Burn
# See github.com/remore/burn
scene 'quine' do
i=0
a='eval x=%q'<<59<<x<<59
b=a.lines
a.lines do
c = b.shift
label c.chomp, 1, i+=1
View cov.rb
require "coverage.so"
Coverage.start
at_exit { p Coverage.result }
View quine.ante
A♦8♥2♦2♠8♥7♦2♠8♥3♦2♠8♥7♦2♠8♥3♦2♠8♥6♦2♠8♥9♦2♠8♥6♦2♠8♥4♦2♠8♥4♦2♠8♥4♦2♠8♥9♦2♠8♥4♦2♠8♥4♦2♠8♥8♦2♠8♥5♦2♠8♥3♦2♠8♥9♦2♠8♥2♦2♠8♥6♦2♠8♥6♦2♠8♥2♦2♠8♥8♦2♠8♥6♦2♠8♥2♦2♠8♥6♦2♠8♥8♦2♠8♥5♦2♠8♥8♦2♠8♥3♦2♠8♥2♦2♠8♥8♦2♠8♥4♦2♠8♥7♦2♠8♥3♦2♠8♥7♦2♠8♥3♦2♠8♥6♦2♠8♥9♦2♠8♥6♦2♠8♥4♦2♠8♥3♦2♠8♥6♦2♠8♥9♦2♠8♥4♦2♠8♥2♦2♠8♥4♦2♠8♥5♦2♠8♥3♦2♠8♥9♦2♠8♥2♦2♠8♥6♦2♠8♥6♦2♠8♥7♦2♠8♥4♦2♠8♥6♦2♠8♥2♦2♠8♥6♦2♠8♥8♦2♠8♥5♦2♠8♥8♦2♠8♥3♦2♠8♥3♦2♠8♥2♦2♠8♥3♦2♠8♥7♦2♠8♥3♦2♠8♥7♦2♠8♥3♦2♠8♥6♦2♠8♥9♦2♠8♥6♦2♠8♥4♦2♠8♥4♦2♠8♥2♦2♠8♥5♦2♠8♥4♦2♠8♥2♦2♠8♥4♦2♠8♥5♦2♠8♥3♦2♠8♥9♦2♠8♥2♦2♠8♥6♦2♠8♥5♦2♠8♥3♦2♠8♥4♦2♠8♥6♦2♠8♥2♦2♠8♥6♦2♠8♥8♦2♠8♥5♦2♠8♥8♦2♠8♥3♦2♠8♥2♦2♠8♥8♦2♠8♥4♦2♠8♥7♦2♠8♥2♦2♠8♥3♦2♠8♥3♦2♠8♥6♦2♠8♥9♦2♠8♥6♦2♠8♥4♦2♠8♥4♦2♠8♥6♦2♠8♥5♦2♠8♥4♦2♠8♥4♦2♠8♥8♦2♠8♥5♦2♠8♥3♦2♠8♥9♦2♠8♥2♦2♠8♥6♦2♠8♥5♦2♠8♥4♦2♠8♥4♦2♠8♥6♦2♠8♥7♦2♠8♥6♦2♠8♥8♦2♠8♥5♦2♠8♥8♦2♠8♥3♦2♠8♥2♦2♠8♥9♦2♠8♥2♦2♠8♥7♦2♠8♥3♦2♠8♥5♦2♠8♥3♦2♠8♥6♦2♠8♥9♦2♠8♥6♦2♠8♥4♦2♠8♥3♦2♠8♥8♦2♠8♥3♦2♠8♥4♦2♠8♥4♦2♠8♥8♦2♠8♥5♦2♠8♥3♦2♠8♥9♦2♠8♥2♦2♠8♥6♦2♠8♥6♦2♠8♥2♦2♠8♥8♦2♠8♥6♦2♠8♥2♦2♠8♥6♦2♠8♥8♦2♠8♥5♦2♠8♥8♦2♠8♥3♦2♠8♥2♦2♠8♥8♦2♠8♥4♦2♠8♥7♦2♠8♥2♦2♠8♥3♦2♠8♥3♦2♠8♥6♦2♠8♥9♦2♠8♥6♦2♠8♥4♦2♠8♥3♦2♠8♥
@mame
mame / gist:7393696
Created Nov 10, 2013
unbelievable hit a vim bug?
View gist:7393696
$ wget https://raw.github.com/michaeldv/unbelievable/master/lib/unbelievable/haiku.rb
--2013-11-10 13:11:03-- https://raw.github.com/michaeldv/unbelievable/master/lib/unbelievable/haiku.rb
Resolving raw.github.com (raw.github.com)... 103.245.222.133
Connecting to raw.github.com (raw.github.com)|103.245.222.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3772 (3.7K) [text/plain]
Saving to: 'haiku.rb'
100%[======================================>] 3,772 --.-K/s in 0s
View gist:6828797
# 0 < A < B を仮定
lower_num, lower_den = 0, 1
upper_num, upper_den = 1, 0
loop do
m_num = lower_num + upper_num
m_den = lower_den + upper_den
case
when m_num < A * m_den then lower_num, lower_den = m_num, m_den
when B * m_den < m_num then upper_num, upper_den = m_num, m_den
View gist:6828520
# 0 < A < B < 1 を仮定
lower, upper = 0, 1
loop do
m = Rational(lower.numerator + upper.numerator, lower.denominator + upper.denominator)
case
when m < A then lower = m
when B < m then upper = m
else p [:found, m]; exit
end
end
View gist:6054528
$ cat test.R
cat("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
View ruby-gnome2-quine.rb
eval s=%q(require"gtk2"
x=y=30
s="eval s=%q(#{s})"
GLib::Timeout.add(50) {
x,c=x+30,s.slice!(0,1)
if c.ord==10
x,y=30,y+30
elsif c.ord!=32
w=Gtk::Window.new
w.set_decorated(false)
View gist:4094725
c:\ruby\rubyinstaller>rake ruby20:package LOCAL=..\ruby
rake aborted!
Don't know how to build task 'ruby20:docs'
Tasks: TOP => ruby20:package => ruby20:package:installer => pkg/rubyinstaller-2.0.0-r37693.exe
(See full trace by running task with --trace)
View gist:4010907
c:\cygwin\home\mame\work\rubyinstaller>rake ruby19 CHECKOUT=1 TRUNK=1 --trace
Loading mingw.rb
Loading mingw64.rb
Loading mingwbuilds.rb
Loading tdm_mingw.rb
Loading certificate.rake
Loading common.rake
Loading defaults.rake
Loading knapsack.rake
Loading openssl.rake