Skip to content

Instantly share code, notes, and snippets.

Avatar

Shugo Maeda shugo

  • NaCl
  • Matsue, Shimane, Japan
View GitHub Profile
View gist:75679dfc60313aa68e8e46e97e385450
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)
View gist:eabc9c67b09e5f4e90afc2b85f98580c
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
View keymap.rb
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[
View gist:6804bcecb00d87a899e6814bc8fb7d5a
Welcome to PRK Firmware!
TUD task started.
Autoreload is ready.
Suspending keymap.
Trying to reload keymap.
keymap.rb found.
@shugo
shugo / t.rb
Created Dec 16, 2021
Unable to find any JVMs matching version "11"
View t.rb
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]
View gist:fbe1514a9677ae409e3de9a115d99b6d
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'
View gist:cf5249a8caafea4112e61f087fac7312
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'
View gist:8a7aa9d7910c8a43f73b450fa4811118
excelsior:prk_firmware$ docker build -o keyboards --build-arg KEYBOARD=prk_runner3680_5x7 .
[+] Building 1.2s (18/20)
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 37B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/ruby:3.0.1-slim 0.8s
=> [build 1/15] FROM docker.io/library/ruby:3.0.1-slim@sha256:b142cf5af 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 117.17kB 0.1s
View map.rb
class Fork < Map
def balance(* in [RedFork[a, xk, xv, b], yk, yv, RedFork[c, zk, zv, d]]) =
RedFork[BlackFork[a, xk, xv, b], yk, yv, BlackFork[c, zk, zv, d]]
def balance(* in [RedFork[RedFork[a, xk, xv, b], yk, yv, c], zk, zv, d]) =
RedFork[BlackFork[a, xk, xv, b], yk, yv, BlackFork[c, zk, zv, d]]
def balance(* in [RedFork[a, xk, xv, RedFork[b, yk, yv, c]], zk, zv, d]) =
RedFork[BlackFork[a, xk, xv, b], yk, yv, BlackFork[c, zk, zv, d]]
def balance(* in [a, xk, xv, RedFork[b, yk, yv, RedFork[c, zk, zv, d]]]) =
RedFork[BlackFork[a, xk, xv, b], yk, yv, BlackFork[c, zk, zv, d]]
def balance(* in [a, xk, xv, RedFork[RedFork[b, yk, yv, c], zk, zv, d]]) =
@shugo
shugo / .textbringer.rb
Last active Jan 8, 2021
Boot time of Textbringer
View .textbringer.rb
require "time"
t = Time.strptime(`LANG=C ps -eo pid,lstart`.slice(/^ *#$$ *(.*)/, 1), "%c")
i = Time.now - t
STDERR.reopen(File.expand_path("~/.textbringer/stderr.log"), "a")
STDERR.puts("Started in #{i} seconds: RUBY_VERSION=#{RUBY_VERSION}")