Skip to content

Instantly share code, notes, and snippets.

@matori
matori / dummy-text.md
Last active June 3, 2023 23:16
日本語・英語・数字がそれなりに混じったダミーテキスト。500字程度。パブリックドメイン。

先発投手の指標:QS (Quality Start)

QS とは Quality Start の略であり、1985年にスポーツライター John Lowe により提唱された。
これは先発投手が少なくとも6イニングを投げ、ER (Earned Runs=自責点) を3以下に抑えた場合に達成される指標で、いわゆる「試合を作れた」かどうかを見るのに使われる。

6イニング3自責点は ERA (Earned Run Average=防御率) にすると 4.5 となり、あまり良いとは言えないように見えるが、2010年シーズン以降の MLB 全体の防御率が 4.08 (2010)、3.94 (2011)、4.01 (2012) であることを見れば、現在でも妥当なラインだと思われる。

また、QS より良いスタートを切った場合の指標も存在する。
HQS (High Quality Start) は少なくとも7イニングを投げ2自責点以内で達成される。
更に UQS (Ultimate Quality Start) という、少なくとも7イニングを投げ自責点なしという指標も提唱されている。

@matori
matori / removehash.js
Created February 12, 2015 02:14
URL からハッシュ値を取得したあとにハッシュを消して履歴を修正
// @link http://stackoverflow.com/a/5298684
var hashString = location.hash.substr(1); // remove '#'
history.replaceState('', document.title, window.location.pathname);
{
"type": "Document",
"raw": "a《《1》》b《2》c《《《3》》》d|《《4》》e《《5》》f",
"range": [
0,
32
],
"loc": {
"start": {
"line": 1,
@matori
matori / convertWp2Html.js
Created December 28, 2019 14:09
WordPressのREST APIで引っ張った全postデータをいい感じに加工してファイルとして出力する
const fs = require("fs")
const dayjs = require("dayjs")
const json = require("./wpdata.json")
console.log(`ファイル数:${json.length}`)
json.forEach((post, index) => {
const date = `${post.date}+09:00`
const modified = `${post.modified}+09:00`
@matori
matori / safe-letters-for-japanese.md
Last active April 26, 2019 13:19
見間違いと聞き間違いを防ぐ英数字を知りたい

1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ

見間違い

  • 1 - i - l - I - L
  • 2 - z - Z
  • 5 - s - S
  • 8 - B
  • 9 - q
  • 0 - o - O
function noScrollFocus(element) {
const x = window.scrollX || window.pageXOffset;
const y = window.scrollY || window.pageYOffset;
element.focus();
window.scrollTo(x, y);
}
@matori
matori / gist:4123325
Created November 21, 2012 06:05
[Modernizr] CSS transforms-style: preserve-3d;
Modernizr.addTest('csstransformspreserve3d', function () {
var prop,
val,
cssText,
ret;
prop = 'transform-style';
if ('webkitTransformStyle' in document.documentElement.style) {
prop = '-webkit-' + prop;
@matori
matori / myrule.json
Last active February 7, 2018 06:57
Karabiner-Elements のカスタムルール
{
"title": "カスタムルール",
"rules": [
{
"description": "右Cmd空打ちでIME切り替え",
"manipulators": [
{
"conditions": [
{
"type": "input_source_if",
@matori
matori / browserslist-stats.json
Created May 5, 2017 11:16
browsers share on my site from 2017-04-01 to 2017-05-01
{
"name": "Unformed Building",
"source": "google_analytics",
"dataByBrowser": {
"ie": {
"6": 0,
"7": 0.016210082671421624,
"8": 0.18641595072134867,
"9": 0.09726049602852974,
"10": 0.17020586804992707,
@matori
matori / memo.md
Last active March 8, 2017 01:15
css-text-3 Segment Break Transformation Rules のメモ