Skip to content

Instantly share code, notes, and snippets.

View mironal's full-sized avatar
🍷

mironal mironal

🍷
View GitHub Profile
@mironal
mironal / gist:bf11918a582af1a1f8fff15bddebb5b6
Last active February 17, 2021 01:40
残り労働時間計算くん
javascript:(function func() {
const SOUROUDOU = "#kt-attendance-category-title-description-accordion-contents > div:nth-child(1) > table:nth-child(2) > tbody > tr:nth-child(2) > td:nth-child(1)"
const SYOTEI_SOWAKU = "#kt-attendance-category-title-description-accordion-contents > div:nth-child(1) > table:nth-child(2) > tbody > tr:nth-child(2) > td:nth-child(2)"
const KYUKA_MINASHI = "#kt-attendance-category-title-description-accordion-contents > div:nth-child(1) > table:nth-child(3) > tbody > tr:nth-child(2) > td:nth-child(11)"
/**
* 指定したセレクタの時間を分で取得
* @param {string} selector
*/
@mironal
mironal / AsyncLoadingContent.swift
Created December 8, 2019 09:45
RxSwift: Add loading status until first next.
//
// AsyncLoadingContent.swift
// Zakkuri
//
// Created by mironal on 2019/12/08.
// Copyright © 2019 mironal. All rights reserved.
//
import Foundation
import RxSwift
@mironal
mironal / Fn.md
Last active July 9, 2019 12:50
filter とか map とかをどのように読むか

filter とか map とかをどのように読むか

flatMap ってなんだろ〜って思ってドキュメント見に行っても

func flatMap<SegmentOfResult>(_ transform: (Self.Element) throws -> SegmentOfResult) rethrows -> [SegmentOfResult.Element] where SegmentOfResult : Sequence

って定義されてるけどこれってどうやって読むんじゃ〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜って状態から、なるほどそういうことねって理解できるようになるための考え方.

@mironal
mironal / RxSwift&MVVM.md
Last active November 12, 2022 03:27
RxSwift と MVVM でiOS アプリを作る上で最低限の登場人物の理解.

RxSwift というか Rx 全般

RxSwift は ReactiveX の Swift 実装.

  • event: Stream に流れるイベント. 値、 error, complated のどれか.
  • Observer: on(event:) を持っている = event を流せる.
  • Observable: subscribe(observer:) -> Disposable を持っている = event を受け取れる/
  • Subject: Observer + Observable
    • PublishSubject: subscribe してから発生した event を受け取れる
  • ReplaySubject: subscribe 以前に発生した event も受け取れる. バッファサイズを指定する.
@mironal
mironal / persist.ts
Created September 9, 2018 23:30
persist plugin for @rematch
import { Plugin } from "@rematch/core"
export interface PersistConfig {
whitelist: string[]
version?: number
delay?: number
debug?: boolean
}
export let persistor: { purge(): void }
@mironal
mironal / karabiner.json
Created July 30, 2018 03:05
A config for Karabiner-Elements for Realforce 91U NG01
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@mironal
mironal / karabiner.json
Created July 30, 2018 03:05
A config for Karabiner-Elements for Realforce 91U NG01
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@mironal
mironal / whitelist.md
Last active January 22, 2018 11:22 — forked from okohs/whitelist.md
20180122_定時前に帰宅できた企業

はじめに

書き方

該当する各社の対応欄に企業名を書いてください。備考があれば適宜カッコ書きしてください。

目的

  • 定時前に帰宅させてくれるホワイトな会社を気軽に作りたい
  • 定時前に帰宅させてくれるホワイトな会社がホワイトアピールできる場があれば良いな

@mironal
mironal / collect_lisence.rb
Created December 19, 2017 10:10
Collect license files for Carthage and cocoapods.
#
# ruby collect_lisence.rb > ALL_LISENCE.md
#
cart_licenses = File.readlines("./Cartfile").map { |line|
line[/.* \".+\/([^\"]+)\".*$/, 1]
}.flat_map { |line|
path = Dir.glob("./Carthage/Checkouts/#{line}/LICENSE*").first
if path
# STDERR.puts "Found: #{line}"
@mironal
mironal / test_fd.rb
Created November 7, 2017 08:06
A test to generate "Too many open files" error.
#test_fd.rb:4:in `initialize': Too many open files in system @ rb_sysopen - 5053.test (Errno::ENFILE)
files = []
1.step do |i|
file = File.open("#{i}.test", "w")
files << file
puts "#{i} => fileno: #{file.fileno}"
end