Skip to content

Instantly share code, notes, and snippets.

View timriley's full-sized avatar
Standing with Ukraine

Tim Riley timriley

Standing with Ukraine
View GitHub Profile
timriley / deps_demo.rb
Created November 13, 2023 19:06
Hanami deps demo with a view
View deps_demo.rb
# frozen_string_literal: true
module Rubyconf2023
module Views
module Posts
class Index < Rubyconf2023::View
include Deps["repos.post_repo"]
# the below is generated courtesy of dry-auto_inject (which hanami configures to work with
# its app/slice containers)
timriley /
Last active November 9, 2023 20:38
Hanami RubyConf 2023 community hack day ideas

Hanami at RubyConf 2023: community hack day

Let’s learn and work on Hanami together at RubyConf! 🌸🙌


Me: Tim Riley (that’s me!) will be at the RubyConf community day representing Hanami. I’m one of the core team, and have been helping drive the Hanami 2.x development work over the last 4+ years.

You: All are welcome! Regardless of your experience level, please come along and we’ll can help you learn the Hanami gem ecosystem and even put together your first contributions to the project.

timriley /
Created September 20, 2018 11:06
Keybase proof

Keybase proof

I hereby claim:

  • I am timriley on github.
  • I am timriley ( on keybase.
  • I have a public key whose fingerprint is 1553 921F DE6E 0649 177E CC44 747A BA12 82E8 8BC9

To claim this, I am signing this object:

timriley / Rakefile
Created August 22, 2018 23:28
Methods defined in Rakefile added to every object, via Kernel
View Rakefile
class MyClass
def foo_from_rake_top_level
namespace :testing do
def foo_from_rake_namespace
timriley / example.rb
Created January 10, 2017 02:23
Example of dry-validation predicate for "unique within some scope"
View example.rb
UserSchema = Dry::Validation.Schema do
configure do
# Hard-coding the custom error messages
def self.messages
en: {errors: {unique_within_account?: 'is not unique within this account'}}
# Here's the custom predicate
timriley / Gemfile
Created November 3, 2016 09:15
dry-auto_inject strategy for Trailblazer 2 operations
View Gemfile
source ""
gem "dry-auto_inject"
timriley / Tim's Tokyo Coffee
Last active October 9, 2016 23:28
Tim's Tokyo Coffee Highlights
View Tim's Tokyo Coffee

Tim’s Tokyo coffee highlights


Bear Pond: Kind of “famous” I think, coffee-focused to the point of arrogance, but Shimokitazawa is an awesome neighbourhood worth visiting anyway (and I bet there are other good cafes around now too).

Around Yoyogi Park

Fuglen: Nicely designed Scandi-style place, very relaxed.

timriley / shell session.txt
Created July 23, 2016 11:11
rspec output for new dry-web-roda app
View shell session.txt
~/S/my_new_app $ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
~/S/my_new_app $ bundle show
Gems included by the bundle:
* addressable (2.4.0)
* bundler (1.12.3)
* byebug (9.0.5)
* capybara (2.7.1)
* capybara-screenshot (1.0.13)
timriley / _pagination.slim
Created January 12, 2016 23:00
Rodakase/ROM pagination
View _pagination.slim
- unless first_page?
a href=url_for_page(1)
| &laquo; First
a href=url_for_page(prev_page) rel="prev"
| &lsaquo; Prev
- if prev_gap?
timriley / gist:11f6716217b49c4b45a2
Last active August 29, 2015 14:21
Workaround for dismissViewControllerAnimated failing to animate a stack of modal view controllers
View gist:11f6716217b49c4b45a2
- (void)loginViewControllerDidClose:(DSLoginViewController *)loginViewController
// Work around a bug(?) where the login VC's view disappears immediately
// (without animation) before our own view then animates away. We want
// only the login VC's view to animate, with all underlying views
// disappearing (invisibly) underneath at the same time. AFAICT, this is
// what _should_ happen: