usage of @remix-run/component
updated_at: 2026-02-05 00:00 +09:00 gist
usage of @remix-run/component
updated_at: 2026-02-05 00:00 +09:00 gist
How to save & load skills from my gist
updated_at: 2026-02-04 13:26 +09:00 gist
usage of @remix-run/interaction
| import { createCache } from "jsr:@deno/cache-dir"; | |
| import { McpServer } from "npm:@modelcontextprotocol/sdk/server/mcp.js"; | |
| import { StdioServerTransport } from "npm:@modelcontextprotocol/sdk/server/stdio.js"; | |
| import { z } from "npm:zod"; | |
| const { load } = createCache(); | |
| function isUint8Array(arg: string | Uint8Array): arg is Uint8Array { | |
| return arg.constructor === Uint8Array; | |
| } |
| require 'set' | |
| Yamanote = %w[とうきょう ゆうらくちょう しんばし はままつちょう たまち しながわ おおさき ごたんだ めぐろ えびす しぶや はらじゅく よよぎ しんじゅく しんおおくぼ たかだのばば めじろ いけぶくろ おおつか すがも こまごめ たばた にしにっぽり にっぽり うぐいすだに うえの おかちまち あきはばら かんだ] | |
| Station = Struct.new(:name, :val) | |
| class Loop | |
| def initialize(array) | |
| @array = array.map do |a| | |
| if a.is_a? Station |
| module HttpUtil | |
| class PathSegment < String | |
| MATCHER = Regexp.new("\\A#{URI::RFC3986_Parser::SEG_NC}+\\Z") | |
| def self.encode_from(str, allow_slash: false) | |
| return str if str.is_a?(PathSegment) | |
| raise 'should not include / in element or use allow_slash option to encode' if !allow_slash && str.include?('/') | |
| new(URI.encode_uri_component(str.unicode_normalize(:nfkc))) | |
| end | |
| def initialize(str) | |
| raise "invalid char: #{str}" unless MATCHER.match?(str) |
| RSpec.configure do |config| | |
| config.before(:suite) { Coverage.start(oneshot_lines: true) } | |
| config.after :suite do | |
| coverage_data = Coverage.result(stop: true, clear: true) | |
| uncovered_lines(coverage_data) | |
| end | |
| end | |
| def parse_git_diff(base_branch) | |
| diff_output, _stderr, _status = Open3.capture3("git diff #{base_branch} --unified=0") |
| # frozen_string_literal: true | |
| run "heroku create #{@app_name}" | |
| gem "pg" | |
| file "config/database.yml", <<~CODE | |
| development: &psql | |
| adapter: postgresql | |
| database: #{@app_name} | |
| pool: 5 |
| # A template to run ubuntu using vmType: vz instead of qemu (Default) | |
| # This template requires Lima v0.14.0 or later and macOS 13. | |
| vmType: "vz" | |
| rosetta: | |
| # Enable Rosetta for Linux. | |
| # Hint: try `softwareupdate --install-rosetta` if Lima gets stuck at `Installing rosetta...` | |
| enabled: true | |
| # Register rosetta to /proc/sys/fs/binfmt_misc | |
| binfmt: true |
| require 'benchmark' | |
| require 'json' | |
| require 'active_support/notifications' | |
| require 'active_support/cache' | |
| array = (1..1000).map { rand } | |
| TIMES = 1000 | |
| Benchmark.bmbm do |x| | |
| cache = ActiveSupport::Cache::FileStore.new("./tmp/cache") |