Skip to content

Instantly share code, notes, and snippets.

View kateinoigakukun's full-sized avatar

Yuta Saito kateinoigakukun

View GitHub Profile

How to use Bundler and RubyGems on WebAssembly

# Download prebuilt ruby
curl -LO https://github.com/ruby/ruby.wasm/releases/download/2022-08-09-a/ruby-head-wasm32-unknown-wasi-full.tar.gz
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
require "net/http"
require "rss"
require "json"
class JenkinsFeed
def self.fetch_all(source)
uri = URI.parse(source)
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
# $ ruby ./bisect-toolchain-snapshot.rb swift-wasm-DEVELOPMENT-SNAPSHOT-2021-12-12-a swift-wasm-DEVELOPMENT-SNAPSHOT-2022-04-06-a run.sh --workdir /tmp/toolchain-bisect
require "date"
require "net/http"
require "json"
require "tmpdir"
def bisect_date_seq(candidates)
bad = 0
good = candidates.length - 1
#!/bin/bash
set -e
if [[ $# -lt 1 ]]; then
echo "Not enough arguments?!"
echo "$0 <hash1> ... <hashN>"
exit 1
fi

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: https://git-scm.com/docs/git-fsck#Documentation/git-fsck.txt-fsckskipList

diff --git a/gcc/config.host b/gcc/config.host
index 0a02c33cc80..e293a8ccc3f 100644
--- a/gcc/config.host
+++ b/gcc/config.host
@@ -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
kateinoigakukun / ruby-dev-shell.nix
Created September 12, 2021 08:22
Nix Shell environment for ruby development
let
pkgs = import <nixpkgs> {};
in
with pkgs;
pkgs.mkShell rec {
nativeBuildInputs = [
clang
git
autoconf

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"
import Foundation
import Logging
#if canImport(FoundationNetworking)
import FoundationNetworking
#endif
public class DiscordLogHandler: LogHandler {
public let label: String
public var userName: String

theme: Next, 4 slidenumbers: true

Swiftのリンク時最適化プロジェクト

わいわいswiftc #21

@kateinoigakukun