Skip to content

Instantly share code, notes, and snippets.

View uhooi's full-sized avatar
🟢

uhooi

🟢
View GitHub Profile
@uhooi
uhooi / parameterized_test_merit.md
Last active December 2, 2019 13:07
「YUMEMI.swift #5 ~Free Talk~」のLTで使用した資料です。

パラメタライズドテストのメリット解説

2019/11/29(金)

@uhooi
uhooi / project.yml
Last active December 5, 2022 15:59
XcodeGen project spec sample
name: {Project Name}
options:
bundleIdPrefix: {Bundle ID Prefix}
deploymentTarget:
iOS: 13.0
xcodeVersion: "11.3.1" # 変わらない?
# findCarthageFrameworks: true # 余計なフレームワークまで追加されてしまうためコメントアウト
carthageExecutablePath: mint run Carthage/Carthage carthage
@uhooi
uhooi / Makefile
Last active July 17, 2023 02:18
Makefile for iOS App development
PRODUCT_NAME := Foo
SCHEME_NAME := ${PRODUCT_NAME}
WORKSPACE_NAME := ${PRODUCT_NAME}.xcworkspace
UI_TESTS_TARGET_NAME := ${PRODUCT_NAME}UITests
TEST_SDK := iphonesimulator
TEST_CONFIGURATION := Debug
TEST_PLATFORM := iOS Simulator
TEST_DEVICE ?= iPhone 11 Pro Max
TEST_OS ?= 13.3
@uhooi
uhooi / Makefile
Last active February 8, 2020 15:44
Makefile for Re:VIEW
REVIEW_VERSION := 4.0
REVIEW_CONFIG_FILE ?= config.yml
REVIEW_OUTPUT_TYPE ?= pdf
REVIEW_BOOKNAME := Foo
.DEFAULT_GOAL := help
.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?# .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":[^#]*? #| #"}; {printf "%-18s%s\n", $$1 $$3, $$2}'
@uhooi
uhooi / ExamLogic.kt
Last active May 18, 2020 00:22
Unit testing sample: 1. Target method before refactoring
package packagename
class ExamLogic {
fun scoreExam(point: Int): String {
if (point < 0 || point > 100) {
return "変な値を送るな!"
}
if (point < 30) {
return "赤点です!"
}
@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
@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 / .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 / iosdc2020_github_actions_article_supplement.md
Last active September 23, 2020 01:52
iOSDC 2020「GitHub ActionsでiOSアプリをCIする個人的ベストプラクティス」パンフレット記事の補足資料
@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(