Skip to content

Instantly share code, notes, and snippets.

View rcarver's full-sized avatar
:shipit:
Building Recentralized.

Ryan Carver rcarver

:shipit:
Building Recentralized.
View GitHub Profile
@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(
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 / 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
}
@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 / 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:
#!/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 / Typekit-Font-Events.md
Created May 14, 2010 22:02
Typekit Font Events

Typekit Font Events

UPDATE: Typekit Font Events have been opensourced as WebFont Loader. Typekit's available events will be updated soon with full support for the WebFont Loader API.


Web fonts may be the best thing to happen to web design in years, but that doesn't mean there aren't some tricky issues to overcome. One of the most annoying things is dealing with what's become known as the FOUT or 'Flash of

@rcarver
rcarver / gist:336091
Created March 18, 2010 05:57
what if resque had hooks for job performing?
def perform
if payload_class.respond_to?(:before_perform)
result = args ? payload_class.before_perform(*args) : payload_class.before_perform
return if result == false
end
begin
args ? payload_class.perform(*args) : payload_class.perform
if payload_class.respond_to?(:after_perform)
args ? payload_class.after_perform(*args) : payload_class.after_perform
end
@rcarver
rcarver / gist:316032
Created February 26, 2010 19:04
Sample cucumber support for Vanity
Scenario: Choose a free plan, then create an account
When I go to the homepage
And I follow "Register"
Then I should see "Find the plan that's right for you"
When I follow "signup-trial"
Then I fill in "First Name" with "Joe"
And I fill in "Last Name" with "Johnson"
And I fill in "Email" with "joe@joe.com"
And I fill in "Password" with "test"
And I fill in "user[password_confirmation]" with "test"
<script type="text/javascript">
// *** EXPERIMENTAL ***
//
// This is an experimental method to be notified when Typekit's fonts have loaded.
//
// It will almost certainly change! Please do not use this on a live site. Please
// do let us know what you think by forking this gist, contacting us at
// support@typekit.com or on Get Satisfaction - http://getsatisfaction.com/typekit
//