Skip to content

Instantly share code, notes, and snippets.

View rcarver's full-sized avatar
:shipit:
Building Aphera, a raw photo editor for Mac.

Ryan Carver rcarver

:shipit:
Building Aphera, a raw photo editor for Mac.
View GitHub Profile
#!/usr/bin/env ruby
# A very simple script to republish all of your kits at Typekit. Just pass your
# api token as the first argument to this script.
#
# Sign up for Typekit http://typekit.com/
# Get an api token at https://typekit.com/account/tokens
require 'net/http'
require 'net/https'
@rcarver
rcarver / Makefile
Created September 11, 2015 22:00
My standard golang + docker development Makefile
check: build test vet lint
test: start-dynamodb
DYNAMODB_HOSTPORT=$$(docker-machine ip ${docker-machine-env}):${dynamodb-port} \
go test ./...
vet:
go vet ./...
lint:
@rcarver
rcarver / Makefile
Last active February 1, 2016 00:53
Example pipeline program in go
run: build
echo 'a\nb\nc\nd\ne' | ./go-pipeline -name a -sleep 1s | ./go-pipeline -name b -sleep 2s
build:
go build -o go-pipeline .
@rcarver
rcarver / AnimationClient.swift
Last active March 3, 2023 05:21
Define animations statically but resolve them at runtime
import Dependencies
import Foundation
import SwiftUI
/// The things you could vary the animation on.
struct AnimationResolutionInput {
// This makes no sense, it's an example!
var colorScheme: ColorScheme
}
import ComposableArchitecture
import SwiftUI
/*
This is a proof of concept for "shared state" in The Composable Architecture.
Goals:
* An ergonomic way for child domains to access data provided by a parent
@rcarver
rcarver / GraphQLVaporDependenciesTests.swift
Created October 25, 2023 22:15
Shows that dependencies loses its context when called from within a GraphQL resolver
import CustomDump
import Dependencies
import Graphiti
import GraphQL
import Vapor
import XCTest
final class DependenciesTests: XCTestCase {
func testStatic() async throws {
let result = try await self.resolve(
@rcarver
rcarver / Notes.md
Last active October 20, 2024 19:55
Notes on improving performance of `ObservableState` with TCA

TCA UI Performance Journey

A few notes on what I've learned over the past week refactoring my app to improve UI performance.

Context

The app manipulates a single large model struct. That struct gets fed into a renderer on all changes to generate an image. The UI is largely made up of sliders, which need to be very responsive. Any extra time on the main thread is noticeable (and I already throttle sliders from the view to the store at ~15fps)

Original Design

import AppKit
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
Text("Click me, then Select All works")
}
.overlay(SelectAllReceiver())
.padding()