Skip to content

Instantly share code, notes, and snippets.

@koutyuke
koutyuke / Rustを超絶丁寧に教えてくれる君.md
Last active October 22, 2026 07:29
Rustを超絶丁寧に教えてくれる君.md

Rustを超絶丁寧に教えてくれる君.md

Role

あなたは Rust の学習を支援するメンターです。 ユーザーは Rust 初学者です。 構文だけでなく、 「なぜそのように書くのか」 「Rust がどんな考え方をするのか」 まで理解することを目指します。

@TAATHub
TAATHub / ChipsSelection.swift
Last active April 17, 2025 18:21
Responsive Chips Selection
// Responsive Chips Selection
// See Also: https://youtu.be/T82izB2XBMA?si=Cnf6rGdyisG8ZWoX
import SwiftUI
struct Tag: Hashable {
var name: String
var color: Color
}
@PlugFox
PlugFox / app_navigator.dart
Last active March 1, 2026 10:37
A simple declarative navigation system for Flutter.
import 'dart:collection';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'pages.dart';
export 'pages.dart';
// --- Navigator --- //
import SwiftUI
extension Color {
static var random: Self {
Color(
hue: .random(in: 0..<1),
saturation: .random(in: (0.9)..<1),
brightness: .random(in: (0.9)..<1)
)
}
struct CardView: View {
var item: ItemData
var animation: Namespace.ID
var body: some View {
HStack {
Circle()
.frame(width: 75)
.foregroundColor(item.color)
.overlay {
@acevif
acevif / rbenv-in-xcode-run-script-phase.md
Last active July 8, 2026 01:17
Xcode の Run Script Phase で rbenv を効かせる方法

Xcode の Run Script Phase で rbenv を効かせる方法

Xcode の Run Script Phase で rbenv が効いておらず困っていたが、解決できたのでメモ

  • Run Script PhaseからPATH環境変数に~/.rbenv/shims/を追加すれば良い。
  • ただし、直接 ~/.rbenv/shims/ を参照するとrbenvに依存してしまう。rbenvは透過的であってほしいのにrbenvに依存してしまってよくない。
  • そこで dependency inversion を行う. Run Script Phase は .xcode-env というスクリプトを呼び出すようにして、.xcode-envは各システム環境で用意する. rbenvを使うべき環境では .xcode-env の中で ~/.rbenv/shims/ を参照する
  • やりたかったこと: fastlaneを(rbenv経由で) 走らせたい
  • .zshenv等でPATHを編集すれば効くかなと思ったらRun Script Phaseの中では効かなかった
  • 下記の記事を参考にした: https://gist.github.com/vyder/2386a03affba03dadb2bc7c3f0bf7b8a
@yimajo
yimajo / Larning_EnvironmentValues.swift
Created January 23, 2020 02:24
SwiftUIのEnvironmentValuesはSubViewに伝搬するしカスタムなKeyも指定できる
/*:
# EnvironmentValuesはSubViewに伝搬するしカスタムなKeyも指定できる
- EnvironmentValuesは特定のKeyに対して値を設定できる
- 標準のKey
- https://developer.apple.com/documentation/swiftui/environmentvalues
- EnvironmentValuesが特定のViewの項目にそのまま紐付いている
- 例えば標準のKeyである\.fontはView上のTextのfontと結びついている
- Keyの値がView暗黙的にバインディングされている感じ
@vyder
vyder / rbenv-in-xcode-build-script.md
Created October 17, 2016 09:24
Using rbenv in an XCode 'Run Script Phase'

If anybody stumbles across this from Google, I found that the simplest thing to do was:

Have devs install rbenv on their machines, and add ~/.rbenv/shims to the PATH in the XCode build script like:

export PATH=~/.rbenv/shims:$PATH
# Exec rest of your script
# ...