Skip to content

Instantly share code, notes, and snippets.

View uhooi's full-sized avatar
🟢

uhooi

🟢
View GitHub Profile
@uhooi
uhooi / DualBackgroundColorScrollView.swift
Last active December 22, 2023 12:32
上部と下部で背景色が異なるスクロールビューの完全な実装
import SwiftUI
/// 上部と下部で背景色が異なるスクロールビュー
///
/// - seeAlso: https://x.com/ynoseda/status/1737120393960558947
public struct DualBackgroundColorScrollView<Content: View>: View {
private let topBackgroundColor: Color
private let bottomBackgroundColor: Color
private let content: () -> Content
@uhooi
uhooi / 取扱説明書.md
Last active August 29, 2023 06:53
uhooiの取扱説明書

働く時間

  • 9:00〜17:45で働きたい
  • 夜や休日に働くのが苦手
  • 緊急/重要なら夜や休日も働く
    • 変に気を遣われるよりは声を掛けてほしい、無理なときは無理と言う

場所や環境

  • リモートワークのときは仕事部屋で作業している
@uhooi
uhooi / .min.vimrc
Created August 6, 2022 12:21
Minimal gin vimrc
syntax enable
filetype plugin indent on
set rtp+=~/temp/gin.vim
set rtp+=~/temp/denops.vim
set rtp+=~/temp/lightline.vim
let g:lightline = {
\ 'active': {
\ 'left': [
@uhooi
uhooi / Optional+Let.swift
Last active September 18, 2021 00:59
Optional+Let.swift
extension Optional {
mutating func `let`(handler: (inout Wrapped) -> Void) {
self = map {
var wrapped = $0
handler(&wrapped)
return wrapped
}
}
}
@uhooi
uhooi / FoundationSample.swift
Last active March 17, 2021 12:56
Morphological Analysis with Swift
// ref: https://developer.apple.com/documentation/foundation/nslinguistictagger
// ref: https://developer.apple.com/documentation/foundation/nslinguistictagger/1410036-enumeratetags
// ref: https://dev.classmethod.jp/articles/ios10-morphological-analysis-from-speechrecognizer/
import Foundation
private func analyzeText(_ text: String, scheme: NSLinguisticTagScheme) {
let tagger = NSLinguisticTagger(tagSchemes: NSLinguisticTagger.availableTagSchemes(forLanguage: "ja"), options: 0)
tagger.string = text
tagger.enumerateTags(
@uhooi
uhooi / iosdc2020_github_actions_article_supplement.md
Last active September 23, 2020 01:52
iOSDC 2020「GitHub ActionsでiOSアプリをCIする個人的ベストプラクティス」パンフレット記事の補足資料
@uhooi
uhooi / .swiftlint.yml
Created May 19, 2020 01:53
たなのなかさんにSwiftLintの設定を教えるためだけのGist。更新しない。
# デフォルト有効で無効にするルール
disabled_rules:
#- block_based_kvo
#- class_delegate_protocol
#- closing_brace
#- closure_parameter_position
#- colon
#- comma
#- compiler_protocol_init
#- control_statement
@uhooi
uhooi / ExamLogic.kt
Last active May 18, 2020 02:00
Unit testing sample: 3. Target method after refactoring
package packagename
class ExamLogic {
fun scoreExam(point: Int): String =
when (point) {
in 0..29 -> "赤点です!"
in 30..79 -> "まあまあです!"
in 80..99 -> "やるじゃん!"
100 -> "天才です!"
else -> "変な値を送るな!"
@uhooi
uhooi / ExamLogicTest.kt
Last active May 18, 2020 01:13
Unit testing sample: 2. Test Method
package packagename
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
class ExamLogicTest {
// region Stored Instance Properties