Skip to content

Instantly share code, notes, and snippets.

@yysaki
yysaki / .gitignore
Last active August 7, 2023 08:01
steep_sample_for_issue_reproduction
.gem_rbs_collection/
@yysaki
yysaki / run.sh
Last active July 2, 2023 01:05
遊戯王 1枚初動率
for i in $(seq 3 12); do ruby yugioh_probability.rb 40 5 $i; done
# deck: 40, hand: 5, hit: 3 -> 33.76%
# deck: 40, hand: 5, hit: 4 -> 42.71%
# deck: 40, hand: 5, hit: 5 -> 50.66%
# deck: 40, hand: 5, hit: 6 -> 57.71%
# deck: 40, hand: 5, hit: 7 -> 63.93%
# deck: 40, hand: 5, hit: 8 -> 69.40%
# deck: 40, hand: 5, hit: 9 -> 74.18%
# deck: 40, hand: 5, hit: 10 -> 78.34%
# deck: 40, hand: 5, hit: 11 -> 81.95%
@yysaki
yysaki / mf_kindle.js
Last active December 15, 2021 08:36
マネーフォワードの未分類なkindle本の支出を本に分類するbookmarklet
javascript:(async () => {
const kindleRow = () => {
const rows = document.querySelectorAll('#cf-detail-table tbody tr');
const kindleRows = [...rows].filter(({ innerText }) => innerText.includes('Kindle') && innerText.includes('未分類'));
return kindleRows[0];
};
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
let row = kindleRow();
@yysaki
yysaki / docker-compose.yml
Created July 5, 2020 03:40
jenkins docker-compose
version: "3"
services:
master:
image: jenkins/jenkins:lts
environment:
- LANG=ja_JP.UTF-8
- LC_CTYPE=ja_JP:ja
- TZ=Asia/Tokyo
volumes:
- ./jenkins_home:/var/jenkins_home
@yysaki
yysaki / main.tf
Created May 23, 2020 09:20
hasura on ECSの素振り
variable "domain" {}
variable "hasura_admin_secret" {}
variable "rds_password" {}
variable "hasura_jwt_secret_key" {}
module "hasura" {
source = "Rayraegah/hasura/aws"
version = "3.0.2"
domain = var.domain
hasura_version_tag = "v1.2.1"
@yysaki
yysaki / index.html
Created April 29, 2020 07:09
react-tic-tac-toe
<div id="root" />
@yysaki
yysaki / booklog-puppeteer.ts
Created January 5, 2020 08:00
booklog読書目標の取得
import puppeteer from 'puppeteer';
const url = 'https://booklog.jp/users/{userName}/goal/{id}';
async function main() {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(url, { waitUntil: 'networkidle0' });
const rows = await page.evaluate(() => {
const ret = Array.from(document.querySelectorAll('table.tableType2 tbody tr'))
@yysaki
yysaki / techbookfest6-reading.md
Last active May 22, 2019 14:45
技術書典6(4/14)で購入した本の積読消化状況

読了した

  1. n月刊ラムダノート Vol.1, No.1(2019)
  2. コンテナ時代のWebサービスの作り方 (写経も完走した)
  3. Pragmatic Terraform on AWS
  4. Microservices architecture よろず本 その一&その二
  5. Microservices architecture よろず本 その三
  6. これでカンタン! ITエンジニアが実践するキャッシュレス時代の資産管理
  7. 妄想実行報告書
  8. ゼロトラスト超入門
@yysaki
yysaki / sieve.rb
Created April 5, 2019 15:59
エラトステネスの篩
def sieve(num)
ary = Array.new(num, true)
ret = []
ary.each_with_index do |b, i0|
next if i0 == 0 || !b
p = i0+1
ret.push p
i0.step(num, p) do |mark|
ary[mark] = false
end
@yysaki
yysaki / bitwise_operetor_about_bool_variable.cpp
Last active August 29, 2015 13:56
bbool型におけるビット演算の挙動を調べるプログラム
#include <iostream>
using namespace std;
int main(int argc, char const* argv[]){
bool ands[4] = {true & true, true & false, false & true, false & false};
bool ors[4] = {true | true, true | false, false | true, false | false};
cout << "ands: ";
for (int i = 0; i < 4; i++) cout << std::boolalpha << ands[i] << " ";