Skip to content

Instantly share code, notes, and snippets.


Yuta Saito kateinoigakukun

View GitHub Profile

How to use Bundler and RubyGems on WebAssembly

# Download prebuilt ruby
curl -LO
tar xfz ruby-head-wasm32-unknown-wasi-full.tar.gz

# Install the same version of native ruby to avoid bundler version mismatch in "BUNDLED WITH" of Gemfile.lock
rbenv install 3.2.0-dev
rbenv local 3.2.0-dev
View swift-community-ci-status-bot.rb
require "net/http"
require "rss"
require "json"
class JenkinsFeed
def self.fetch_all(source)
uri = URI.parse(source)
http =, uri.port)
http.use_ssl = true
View bisect-toolchain-snapshot.rb
# $ ruby ./bisect-toolchain-snapshot.rb swift-wasm-DEVELOPMENT-SNAPSHOT-2021-12-12-a swift-wasm-DEVELOPMENT-SNAPSHOT-2022-04-06-a --workdir /tmp/toolchain-bisect
require "date"
require "net/http"
require "json"
require "tmpdir"
def bisect_date_seq(candidates)
bad = 0
good = candidates.length - 1
View git-pr-commit
set -e
if [[ $# -lt 1 ]]; then
echo "Not enough arguments?!"
echo "$0 <hash1> ... <hashN>"
exit 1

Since version 2.23, git-blame has a feature to ignore certain commits. This feature is useful to ignore large formatting or apparently unimportant changes.

How to use

  1. Create a revisions list file. The file name is usually .git-blame-ignore-revs
  2. Set the file as a default ignore file for blame by git config blame.ignoreRevsFile .git-blame-ignore-revs

The file format is described in git-fsck's man:

View aarch64-darwin-riscv-gcc.patch
diff --git a/gcc/ b/gcc/
index 0a02c33cc80..e293a8ccc3f 100644
--- a/gcc/
+++ b/gcc/
@@ -255,6 +255,9 @@ case ${host} in
out_host_hook_obj="${out_host_hook_obj} host-i386-darwin.o"
host_xmake_file="${host_xmake_file} i386/x-darwin"
+ aarch64-*-darwin*)
+ out_host_hook_obj="${out_host_hook_obj} host-default.o"
kateinoigakukun / ruby-dev-shell.nix
Created September 12, 2021 08:22
Nix Shell environment for ruby development
View ruby-dev-shell.nix
pkgs = import <nixpkgs> {};
with pkgs;
pkgs.mkShell rec {
nativeBuildInputs = [

Trace Server requests/responses in VSCode

Add the following configurations in settings.json. The top level id (Ruby TypeProf) is a language client id specified as the first argument of the constructor of LanguageClient. like new LanguageClient("Ruby TypeProf", ...);

    "Ruby TypeProf.trace.server": {
        "verbosity": "verbose",
 "format": "Text"
View LoggingDiscord.swift
import Foundation
import Logging
#if canImport(FoundationNetworking)
import FoundationNetworking
public class DiscordLogHandler: LogHandler {
public let label: String
public var userName: String

theme: Next, 4 slidenumbers: true


わいわいswiftc #21