Skip to content

Instantly share code, notes, and snippets.

@matori
matori / example.js
Created May 26, 2024 12:53
カクヨム用一字下げスクリプト
// ==UserScript==
// @name カクヨム一字下げスクリプト
// @namespace http://tampermonkey.net/
// @version 2024-05-24
// @description try to take over the world!
// @author You
// @match https://kakuyomu.jp/works/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=kakuyomu.jp
// @grant none
// ==/UserScript==
{
"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
@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,
function noScrollFocus(element) {
const x = window.scrollX || window.pageXOffset;
const y = window.scrollY || window.pageYOffset;
element.focus();
window.scrollTo(x, y);
}
@matori
matori / memo.md
Last active March 8, 2017 01:15
css-text-3 Segment Break Transformation Rules のメモ
@matori
matori / alphafy.scss
Created April 5, 2016 12:11
Convert colort to alpha
// http://paulownia.hatenablog.com/entry/20100420/1271769659
@function alphafy($front, $back, $alpha) {
$r: round((red($front) - red($back) * (1 - $alpha)) / $alpha);
$g: round((green($front) - green($back) * (1 - $alpha)) / $alpha);
$b: round((blue($front) - blue($back) * (1 - $alpha)) / $alpha);
@if($r < 0) {$r: 0;}
@if($r > 255) {$r: 255}
@if($g < 0) {$g: 0;}
@if($g > 255) {$g: 255}
@if($b < 0) {$b: 0;}
@matori
matori / index.html
Created March 31, 2016 03:54
styleMatchTester.js
<script src="path/to/style-match-tester.js"></script>
<script>
var config = {
"html": {
pseudo: "::before",
prop: {
"display": "block",
"border-top-width": "0",
"font-size": "",