Skip to content

Instantly share code, notes, and snippets.

View ya-s-u's full-sized avatar
🍺
Drinking

Yasuaki Goto ya-s-u

🍺
Drinking
View GitHub Profile
@ya-s-u
ya-s-u / StoryboardInstantiatable.swift
Last active January 4, 2018 00:53
StoryboardInstantiatable
//: Playground - noun: a place where people can play
import UIKit
protocol ContextInjectable {
associatedtype Context = Void
func inject(_: Context)
}
extension ContextInjectable where Context == Void {
@ya-s-u
ya-s-u / appstate.txt
Created February 15, 2018 07:42
AppState
+------------------------------------------------+
| active |
+------------------------------------------------+
^ |
| |
didBecomeActive willResignActive
| |
| v
+------------------------------------------------+
| inactive |
@ya-s-u
ya-s-u / gist:7c04d8dc40b012d9e4924946ddc1c45a
Created November 5, 2019 05:12 — forked from jmblog/gist:6077993
所得税と住民税の計算方法

所得税(国税)

所得税の計算方法

所得税額 = (所得金額(A) - 所得控除額(B)) × 税率 - 税額控除額(C)

  • 「所得金額(A)- 所得控除額(B)」は 課税所得金額 といい、1,000円未満の端数を切り捨てる。

所得税の税率

@ya-s-u
ya-s-u / parser.ts
Created March 3, 2022 14:14
パーサーコンビネータ
interface Done<T> {
type: 'done';
result: T;
tail: string;
};
interface Failed {
type: 'failed';
};
@ya-s-u
ya-s-u / findInBatches.ts
Created June 27, 2023 16:55
Prisma extensions
import { Prisma } from '@prisma/client'
interface Omit {
<T extends object, K extends [...(keyof T)[]]>(obj: T, ...keys: K): {
[K2 in Exclude<keyof T, K[number]>]: T[K2]
}
}
const omit: Omit = (obj, ...keys) => {
const ret = {} as {