Skip to content

Instantly share code, notes, and snippets.

View matsubo's full-sized avatar

Yuki Matsukura matsubo

View GitHub Profile
<?php
$result = [
0 => 0,
1 => 0
];
for ($i = 0 ; $i < 100000000 ; $i++) {
$rand_number = mt_rand();
diff --git a/Gemfile b/Gemfile
index ddc9c44..d824388 100644
--- a/Gemfile
+++ b/Gemfile
@@ -96,4 +96,6 @@ group :test do
gem 'capybara-screenshot'
gem 'rspec-rails'
+ gem "timecop"
end
@matsubo
matsubo / Gemfile
Last active February 15, 2023 07:48
My rubocop setting template.
gem 'rubocop', require: false
gem 'rubocop-performance', require: false
gem 'rubocop-rails', require: false
gem 'rubocop-rspec', require: false
@matsubo
matsubo / docker-compose.yml
Created February 11, 2023 15:46
Build a HTTP3 enabled nginx
version: '3.8'
services:
nginx:
image: nwtgck/nginx-http3
ports:
- '443:443/udp'
restart: always
volumes:
- ./nginx.conf:/usr/local/nginx/conf/nginx.conf
- /etc/letsencrypt/live/train.teraren.com/fullchain.pem:/etc/ssl/certs/server.crt
@matsubo
matsubo / README.md
Last active February 4, 2023 15:54
Minecraft bedrock server systemd setting. This is working on Ubuntu 22.04.1 LTS

Minecraft bedrock server systemd setting

% curl -s https://gist.githubusercontent.com/matsubo/203ab161b8cc5d0e7495b1c24665ac02/raw/d937c1cd5922992795038e8e58a52edfa413265b/bedrock.service > bedrock.service
% vi bedrock.service # edit user name and path.
% sudo mv bedrock.service /etc/systemd/system/
% sudo chown root.root /etc/systemd/system/bedrock.service
% sudo systemctl start bedrock
% sudo systemctl status bedrock.service
irb(main):001:0> require 'carmen'
=> true
irb(main):002:0> include Carmen
=> Object
irb(main):003:0> jp = Country.named('Japan')
=> <#Carmen::Country name="Japan">
irb(main):004:0> jp.subregions?
=> true
irb(main):005:0> jp.subregions
=>
@matsubo
matsubo / Dockerfile
Created December 13, 2022 16:13
rails 7 first step
FROM ruby:3
RUN mkdir /app
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install
ADD . /app

OpenAPI Specification

  • OAS3 (OpenAPI Specification Version 3) で書かれている仕様書とAPIのまとめです。
  • OpenAPIで記述されたAPI仕様書はサンプルはWeb上に公開されているケースが多いですが、実際に運用されているAPIの仕様書が公開されている例が少ないのでこちらでまとめておきます。

郵便番号検索API

@matsubo
matsubo / near_by_stations.html
Last active June 7, 2022 04:12
最寄りの駅情報をJavascriptで取得するコード
<div class="form-control w-full max-w-full" data-controller="doc">
<label class="label">
<span class="label-text">経度</span>
</label>
<input type="text" data-doc-target="lon" name="lon" id="lon" placeholder="139.738999" value=""
class="input input-bordered w-full max-w-xs" />
<label class="label">
<span class="label-text">緯度</span>
</label>
RUN bin/download-chromedriver.sh && mv chromedriver /usr/local/bin/