Skip to content

Instantly share code, notes, and snippets.

卜部昌平 shyouhei

Block or report user

Report or block shyouhei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
shyouhei / gist:266178ffedab5767a5b69b972c76f88a
Created Sep 27, 2017
View gist:266178ffedab5767a5b69b972c76f88a






shyouhei / git-strata.rb
Last active Dec 8, 2019
This is git-strata, an extended version of git-blame. It takes a path and generates git-blame like output. The difference is, it also shows you how much edits the line experienced.
View git-strata.rb
#! /your/favourite/path/to/ruby
# -*- coding: utf-8 -*-
# Copyright (c) 2013 Urabe, Shyouhei
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
shyouhei / gist:0b7dab3e75bfbf96f895
Created Mar 31, 2015
View gist:0b7dab3e75bfbf96f895


  • 勤務先との書面による「労働契約」。業務委託契約等NG。
  • 多寡を問わず毎月払われる給料。遅配等論外である。
  • 健康保険。
  • 労災保険。
  • 雇用保険。
  • 三六協定。
  • 年次有休。
  • 育児休業の制度があり取得者がいる会社に勤務する。
View 0001-optimize-CLASS_OF.patch
From 98be06eba1e2f09bbfba9c63ec5f79581ad7a5fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
Date: Wed, 23 Oct 2019 17:10:10 +0900
Subject: [PATCH] optimize CLASS_OF
include/ruby/ruby.h | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
View 0001-optimize-CLASS_OF.patch
From edb99670b714b12525f36d6f9b174a72a75026b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
Date: Wed, 23 Oct 2019 17:10:10 +0900
Subject: [PATCH] optimize CLASS_OF
include/ruby/ruby.h | 28 +++++++++++++++++++---------
1 file changed, 19 insertions(+), 9 deletions(-)
View 0001-greetings.patch
From 7b6bbba78cb2fcfb2a9def7d2c31aad64c03b5c5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
Date: Wed, 24 Jul 2019 16:29:59 +0900
Subject: [PATCH] greetings.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 卜部昌平 <>
shyouhei /
Last active Jul 22, 2019
include-what-you-use is a garbage.

ASUS ZenBook 3 ファーストインプレッション

前使ってたSony VAIO Pro 11が壊れた。


とはいうものの壊れてしまったので、別のものを買わなければいけないのだが、残念ながら今回はVAIOは選択肢に入らない。VAIO Pro 11に相当する後継製品がないからだ。なおS11はキーボードがNG。

色々と調べた限りでは国内で買える選択肢は少なそう。しょうがないので、ASUS ZenBook 3 UX390UAKを個人輸入でUS Amazonで買った。

View 0001-send-pop-optimisation-part-two-eliminate-pop.patch
From 366e7e37b5f54c5d359a32f4324b6b90a6c7d33a Mon Sep 17 00:00:00 2001
From: "Urabe, Shyouhei" <>
Date: Mon, 21 Jan 2019 19:04:17 +0900
Subject: [PATCH] send-pop optimisation part two: eliminate pop
Sending a method, then immediately throwing away its return value, is
one of the most frequent waste of time that ruby does. Now that
callee methods can skip pushing objects onto the stack, why not caller
sites to also avoid popping them.
shyouhei / md2dom.rb
Created Feb 20, 2017
DOM of a Markdown document. Because Redcarpet is strongly HTML-centric we cannot pass non-String return values around. We instead have to retain all generated s-expressions and left markers of them in the return value. The DOM is constructed back from that info after we finished rendering.
View md2dom.rb
#! /your/favourite/path/to/ruby
# -*- coding: utf-8 -*-
# -*- frozen_string_literal: true -*-
# -*- warn_indent: true -*-
require 'redcarpet'
class MD2DOM < Redcarpet::Render::Base
def preprocess str
@sexp = []
You can’t perform that action at this time.