Skip to content

Instantly share code, notes, and snippets.

View Kuniwak's full-sized avatar
💭
I may be slow to respond.

Yuki Kokubun Kuniwak

💭
I may be slow to respond.
View GitHub Profile
count(List, X, Count) :- count_sub(List, X, 0, Count).
count_sub([], _, N, N).
count_sub([Head | Xs], X, N, Count) :-
(Head == X -> N1 is N + 1; N1 is N),
count_sub(Xs, X, N1, Count).
% トランプの数は1〜13まで。
card(X) :- between(1, 13, X).
% さやかのヒントにあてはまる。
{!(number|boolean)}
{!Object}
{!number|!string}
{!{myNum: number}}
{"foo.bar.baz"}
{'foo.bar.baz'}
{(Array.<string>|Object.<string, ?>)}
{(Array|Object.<string, ?>)}
{(Element|Object|Document|Object.<string, (string|function(!jQuery.event=))>)=}
{(Error|function(): Error)}
$ ruby --version
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]

$ bundle list | grep kitchen
  * kitchen-ansible (0.45.9)
  * kitchen-vagrant (1.0.1)
  * test-kitchen (1.15.0)
@Kuniwak
Kuniwak / kuniwak-resume.md
Last active December 29, 2025 03:37
Kuniwak (Yuki Kokubun) の職務経歴書

自己紹介

SET(Software Engineer in Test) のグループの元マネージャ。専門は ソフトウェアテスト/Lint/Git。実務経験のあるプログラミング言語は JavaScript, TypeScript, Swift, C#, Go, Isabelle, OCaml, F#(コードは OSS を参照)。

(2025/12 現在)転職活動はしていません。

提供できる価値

@Kuniwak
Kuniwak / SE0176Tests.swift
Last active January 25, 2018 10:50
SE-0176 の理解を確認するための例題集です
// 問題: コンパイルエラーもしくは実行時警告になる testX 関数をすべて答えてください。
import XCTest
class SE0176PlaygroundTests: XCTestCase {
func test1() {
struct ExampleStruct {
mutating func assignedBy(_ block: () -> ExampleStruct) {
self = block()
@Kuniwak
Kuniwak / XCTContextPached.swift
Created August 7, 2018 11:50
Workaround for XCTContext.runActivity on AppCode.
import _SwiftXCTestOverlayShims
public extension XCTContext {
// XXX: This is for AppCode. The original of runActivity have been failed on only AppCode.
// This cause is __XCTContextShouldStartActivity, it returns true when it is called on Xcode, but not on AppCode.
public class func runActivityPatched<Result>(named name: String, block: (XCTActivity) throws -> Result) rethrows -> Result {
let context = _XCTContextCurrent()
return try autoreleasepool {
let activity = _XCTContextWillStartActivity(context, name, XCTActivityTypeUserCreated)
public protocol PositiveInt: Equatable {}
public struct Succ<T>: PositiveInt where T: PositiveInt {
private let x: T
fileprivate init(_ x: T) { self.x = x }
}
public struct Zero: PositiveInt {
public static func ==(lhs: Zero, rhs: Zero) -> Bool { return true }
}
public typealias One = Succ<Zero>
public typealias Two = Succ<One>
%{
number_of_generated = 5
}%
public struct PrefixedArray<Element, RestElements> {
public let prefix: Element
public let rest: RestElements
public enum Result<T, E> {
case success(T)
case failure(because: E)
public var isSuccess: Bool {
switch self {
case .success:
return true
case .failure:
class A { a: "a" = "a"; }
class B { b: "b" = "b"; }
interface X {
a: Y<A>;
b: Y<B>;
}
interface Y<T> { t: T; }
type Z<T> = { [key in "a"]: Y<T> };