Skip to content

Instantly share code, notes, and snippets.

View shugo's full-sized avatar

Shugo Maeda shugo

  • NaCl
  • Matsue, Shimane, Japan
View GitHub Profile
excelsior:test$ ./cobench
[0x10b4e3600] measuring co_create+co_delete performance ...
[0x10b4e3600] 0.186263 usec
[0x10b4e3600] measuring switch performance ...
zsh: segmentation fault ./cobench
@shugo
shugo / gist:4a535cea6a3a2bdab7c2225326a080bd
Last active October 25, 2022 01:26
Perfume Coroutine Test
excelsior:perfume$ cat t.prfm
set c [coro {
println "1st step";
pause;
println "2nd step";
}];
$c next; # → "1st step"
$c next; # → "2nd step"
$c release;
excelsior:perfume$ perfumesh t.prfm
def evaluate(expr)
case expr
in ["value", x]
x
in ["+", x, y]
evaluate(x) + evaluate(y)
in ["-", x, y]
evaluate(x) - evaluate(y)
in ["*", x, y]
evaluate(x) * evaluate(y)
Loaded suite test/textbringer/commands/test_isearch
Started
.F
===============================================================================
Failure: test_isearch_backward(TestIsearch)
test/textbringer/commands/test_isearch.rb:132:in `test_isearch_backward'
129: buffer.end_of_buffer
130: push_keys("茶を\C-r\n")
131: isearch_backward(recursive_edit: true)
=> 132: assert_equal(7, buffer.current_line)
b9007b6c548f91e88fd3f2ffa23de740431fa969 is the first bad commit
commit b9007b6c548f91e88fd3f2ffa23de740431fa969
Author: Koichi Sasada <ko1@atdot.net>
Date: Wed Jan 8 16:14:01 2020 +0900
Introduce disposable call-cache.
This patch contains several ideas:
(1) Disposable inline method cache (IMC) for race-free inline method cache
kbd = Keyboard.new
kbd.split = true
kbd.init_pins(
[ 4, 5, 6, 7, 8 ],
[ 28, 27, 26, 22, 20, 23, 21 ]
)
kbd.add_layer :default, %i[
Welcome to PRK Firmware!
TUD task started.
Autoreload is ready.
Suspending keymap.
Trying to reload keymap.
keymap.rb found.
@shugo
shugo / t.rb
Created December 16, 2021 03:38
Unable to find any JVMs matching version "11"
require "open3"
cmd = "echo foo"
CONFIG = { shell_file_name: "/bin/zsh", shell_command_switch: "-c" }
signals = [:INT, :TERM, :KILL]
begin
opts = /mswin|mingw/ =~ RUBY_PLATFORM ? {} : {pgroup: true}
if CONFIG[:shell_file_name]
cmd = [CONFIG[:shell_file_name], CONFIG[:shell_command_switch], cmd]
ArgumentError: wrong number of arguments (given 2, expected 1)
<internal:timev>:271:in `at'
/Users/shugo/.rbenv/versions/master/lib/ruby/gems/3.1.0/gems/rroonga-11.0.6/lib/groonga/record.rb:478:in `[]'
/Users/shugo/.rbenv/versions/master/lib/ruby/gems/3.1.0/gems/rroonga-11.0.6/lib/groonga/record.rb:478:in `method_missing'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:598:in `block in show_search_result'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:596:in `each'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:596:in `map'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:596:in `show_search_result'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:444:in `block (3 levels) in <class:SummaryMode>'
/Users/shugo/src/textbringer/lib/textbringer/controller.rb:141:in `block in read_event'
ArgumentError: wrong number of arguments (given 2, expected 1)
<internal:timev>:271:in `at'
/Users/shugo/.rbenv/versions/master/lib/ruby/gems/3.1.0/gems/rroonga-11.0.0/lib/groonga/record.rb:478:in `[]'
/Users/shugo/.rbenv/versions/master/lib/ruby/gems/3.1.0/gems/rroonga-11.0.0/lib/groonga/record.rb:478:in `method_missing'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:598:in `block in show_search_result'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:596:in `each'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:596:in `map'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:596:in `show_search_result'
/Users/shugo/src/mournmail/lib/mournmail/summary_mode.rb:444:in `block (3 levels) in <class:SummaryMode>'
/Users/shugo/src/textbringer/lib/textbringer/controller.rb:141:in `block in read_event'