Skip to content

Instantly share code, notes, and snippets.

View hiragram's full-sized avatar

Yuya Hirayama hiragram

View GitHub Profile

Docker + Claude Code + xcode-remote アーキテクチャ

Claude Codeを --dangerously-skip-permissions で自律的に動かしつつ、ホストのMac環境を汚さず、かつXcodeビルドなどMacでしか実行できない操作も可能にする仕組みの解説。

解決したい課題

Claude Codeの --dangerously-skip-permissions は強力だが、ホスト環境で直接実行すると以下のリスクがある:

  • ファイルシステムへの無制限なアクセス
  • 任意のシェルコマンドの実行
extension Array {
var hoge: String {
return ""
}
}
extension Array where Element: Integer {
var hoge: Int {
return 1
}
let count = 100_000_000
let dropCount = count - 1
let array = Array(1...count)
// print(array.dropFirst(dropCount).first) // A
print(array[dropCount]) // B
public extension Dictionary {
// ①
func get<T>(valueForKey key: Key) throws -> T {
guard let value = self[key] as? T else {
throw DictionaryExtractionError.castFailed(key: String.init(describing: key), actualValue: self[key])
}
return value
}
// ②
{
"messages": [
{
"user": {
"name": "田中 太郎",
"image_url": "https://pbs.twimg.com/profile_images/736418346975907840/tOgSnNgI.jpg"
},
"text": "日報の雑感日報の雑感日報の雑感日報の雑感日報の雑感日報の雑感",
"created_at": 1468320824
},
{ "message": "PONG" }
import Foundation
protocol NibInstantiatable {
static var nibName: String { get }
static func instantiateFromNibWithOwner(ownerOrNil: AnyObject?, options: [NSObject: AnyObject]?) -> Self
}
extension NibInstantiatable where Self: UIView {
static var nibName: String {
while($i=<STDIN>){chomp($i);@j=split(/ /, $i);@h=split(/,/, $j[0]);foreach(reverse(@h)){substr($j[1], $_, 0)=" "}print($j[1]."\n");}
while line = gets
puts line
end
while l=gets
puts l
end