Skip to content

Instantly share code, notes, and snippets.

View ksoda's full-sized avatar
👯‍♀️
I may be slow to respond.

Ken Sonoda ksoda

👯‍♀️
I may be slow to respond.
  • Tokyo
View GitHub Profile
@ksoda
ksoda / gist:7fdfa33f43148bc265779cbaa673274d
Last active June 6, 2023 15:38
メソドロジと可観測性ツール

Memo: メソドロジと可観測性ツール

詳解 システム・パフォーマンスから。よくわからない箇所を書き留めるための文書。

メソドロジと分析

仕事を省略できるので性能チューニングは仕事をする場所付近で行うと効果が高い。 チューニング2.3.4やワークロードの特性の把握2.5.10参照。

方向性を定めるため目標を定めると、行動を選択するとき役立つ。定まればあとは要因を探すだけだ。

@ksoda
ksoda / file
Created May 3, 2023 14:52
test
‎‎​
@ksoda
ksoda / openpgp.md
Last active February 12, 2023 12:40

openpgp4fpr:3998E3DE9E1C948D394A0154371F2E5A0E0B0BE6

@ksoda
ksoda / keybase.md
Last active January 29, 2023 19:19
keybase.md

Keybase proof

I hereby claim:

  • I am ksoda on github.
  • I am kensono (https://keybase.io/kensono) on keybase.
  • I have a public key whose fingerprint is 444F 2B4E 46D0 04B0 99F8 B114 D227 5094 0348 76CE

To claim this, I am signing this object:

psql -U postgres -h localhost \
-XAtc "SELECT tablename FROM pg_catalog.pg_tables where schemaname='public'" | while read table
do psql -U postgres -h localhost \
-c "\copy (SELECT * FROM $table) to $table.csv with csv header"
done
begin
require 'bundler/inline'
rescue LoadError => e
warn 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
@ksoda
ksoda / read.rs
Last active November 3, 2021 12:32
VS Code snippet
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> Option<T> {
let mut b = String::new();
std::io::stdin().read_line(&mut b).ok();
b.trim().parse().ok()
}
/// # Examples
/// ```
/// let mtx = (0..2).map(|_| read_v().unwrap()).collect();
class NoPoopInString < Base
extend AutoCorrector
MSG = 'Where did you learn that?'
def on_str(node)
bad = '💩'
return unless node.source.include?(bad)
add_offense(node) do |corrector|
corrector.replace(node, node.source.tr(bad, '🌈'))
end
# frozen_string_literal: true
class SimpleKvs # :nodoc:
def self.call(file_name)
raf = File.open(file_name, 'r+')
new(raf)
end
def initialize(raf)
@raf = raf
@ksoda
ksoda / _main.md
Last active July 24, 2020 15:51
実践的な例 Alloy part 3

Alloy part 3

前回の続き。

ホテルの客室施錠

錠前は次の性質を持つ。

  • 現在の鍵の組み合わせを保持する
  • 疑似乱数を生成する(フィードバックレジスタ)