Share
Embed
Browser History Confessional: Searching My Recent Searches
We all only have so much working memory available in our brains. Developers may joke about spending their day composing search engine queries. The reason it's a joke is because of the truth behind it. Search-driven development is a reality.
Join me, and my actual search history, on a journey to solve recent challenges I faced. I'll categorize the different types of information I often search for. You'll leave with tips on retrieving the knowledge you need for your next bug, feature, or pull request.
Kevin Murphy
April 27, 2022
Transcript
119 slides
-
Mine @kevin_j_m Alluvial Deposit Active Search History kevinjmurphy.com/alluvial how to
give a good presentation -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History kevinjmurphy.com/alluvial
how to give a good presentation Be prepared Look at the audience Read this before you get on stage -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History About
Me Kevin Murphy Personal Website kevinjmurphy.com @kevin_j_m / Twitter twitter.com BookBub: handpicked ebook deals bookbub.com BookBub is Hiring! bookbub.com/careers Tech Leads & Mobile Devs Ads -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
History 2 how to give a good presentation Kevin Murphy -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
History 2 how to give a good presentation Kevin Murphy May 18, 2022 10:31 AM May 18, 2022 10:32 AM -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component_test.rb class DateTimeComponentTest < ViewComponent::TestCase test "displays the formatted date and time" do end end timestamp ruby Recall Details -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component_test.rb class DateTimeComponentTest < ViewComponent::TestCase test "displays the formatted date and time" do time = DateTime.new(2022, 3, 20, 3, 25, 6) end end timestamp ruby Recall Details -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component_test.rb class DateTimeComponentTest < ViewComponent::TestCase test "displays the formatted date and time" do time = DateTime.new(2022, 3, 20, 3, 25, 6) render_inline(DateAndTimeComponent.new(time)) end end timestamp ruby Recall Details -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component_test.rb class DateTimeComponentTest < ViewComponent::TestCase test "displays the formatted date and time" do time = DateTime.new(2022, 3, 20, 3, 25, 6) render_inline(DateAndTimeComponent.new(time)) assert_selector "p", id: "date", text: "Mar 20, 2022" end end timestamp ruby Recall Details -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component_test.rb class DateTimeComponentTest < ViewComponent::TestCase test "displays the formatted date and time" do time = DateTime.new(2022, 3, 20, 3, 25, 6) render_inline(DateAndTimeComponent.new(time)) assert_selector "p", id: "date", text: "Mar 20, 2022" assert_selector "p", id: "time", text: "03:25 AM" end end timestamp ruby Recall Details -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component.html.erb <div> <p id="date"> <%= l(@timestamp, format: :date) %> </p> <p id="time"> <%= l(@timestamp, format: :time_of_day) %> </p> </div> timestamp eruby Recall Details -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL config/locales/en.yml en: time: formats: date: "" time_of_day: "" timestamp yaml Recall Details -
@kevin_j_m Recall Details > rails test # Running F Finished
in 0.414796s, 45.8056 runs/s, 4.9408 assertions/s 1 runs, 1 assertions, 1 failures, 0 errors, 0 skips -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Recall
Details ruby strftime Class: DateTime (Ruby 3.1.1) ruby-doc.org strftime (DateTime) - APIdock apidock.com Ruby Date Format (strftime) Cheat Sheet shortcutfoo.com -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Recall
Details ruby strftime Class: DateTime (Ruby 3.1.1) ruby-doc.org strftime (DateTime) - APIdock apidock.com Ruby Date Format (strftime) Cheat Sheet shortcutfoo.com -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL config/locales/en.yml en: time: formats: date: "" time_of_day: "" timestamp yaml Recall Details -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL config/locales/en.yml en: time: formats: date: "%b %-d, %Y" time_of_day: "%I:%M %p" timestamp yaml Recall Details -
@kevin_j_m Recall Details > rails test # Running . Finished
in 0.414796s, 45.8056 runs/s, 4.9408 assertions/s 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Recall
Details 1 ruby strftime May 18, 2022 10:35 AM Bookmark search by keywords Reference materials -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL datetime_helper.rb module DatetimeHelper def l_datetime(timestamp, placeholder: "Unknown", **opts) end end placeholder ruby Solve Direct Problems -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL datetime_helper.rb module DatetimeHelper def l_datetime(timestamp, placeholder: "Unknown", **opts) if timestamp.present? else end end end placeholder ruby Solve Direct Problems -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL datetime_helper.rb module DatetimeHelper def l_datetime(timestamp, placeholder: "Unknown", **opts) if timestamp.present? l(timestamp, **opts) else end end end placeholder ruby Solve Direct Problems -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL datetime_helper.rb module DatetimeHelper def l_datetime(timestamp, placeholder: "Unknown", **opts) if timestamp.present? l(timestamp, **opts) else placeholder end end end placeholder ruby Solve Direct Problems -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component.html.erb <div> <%= heroicon "calendar" %> <p id="date"> <%= l(@timestamp, format: :date) %> </p> </div> placeholder eruby Solve Direct Problems -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component.html.erb <div> <%= heroicon "calendar" %> <p id="date"> <%= l_datetime(@timestamp, format: :date) %> </p> </div> placeholder eruby Solve Direct Problems -
@kevin_j_m Solve Direct Problems > rails test # Running Error:
DateTimeComponentTest#test_displays_the_formatted_date: NoMethodError: undefined method `l_datetime' for #<DateTimeC -
@kevin_j_m Solve Direct Problems > rails test # Running Error:
DateTimeComponentTest#test_displays_the_formatted_date: NoMethodError: undefined method `l_datetime' for #<DateTimeC -
@kevin_j_m Solve Direct Problems > rails test # Running Error:
DateTimeComponentTest#test_displays_the_formatted_date: NoMethodError: undefined method `l_datetime' for #<DateTimeC Ruby Exception -
@kevin_j_m Solve Direct Problems > rails test # Running Error:
DateTimeComponentTest#test_displays_the_formatted_date: NoMethodError: undefined method `l_datetime' for #<DateTimeC app/helpers/datetime_helper.rb Ruby Exception -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component.html.erb <div> <%= heroicon "calendar" %> <p id="date"> <%= l_datetime(@timestamp, format: :date) %> </p> </div> placeholder eruby Solve Direct Problems -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL date_time_component.html.erb <div> <%= heroicon "calendar" %> <p id="date"> <%= helpers.l_datetime(@timestamp, format: :date) %> </p> </div> placeholder eruby Solve Direct Problems -
@kevin_j_m Solve Direct Problems > rails test # Running .
Finished in 0.414796s, 45.8056 runs/s, 4.9408 assertions/s 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
History Comments 2 ruby strftime May 18, 2022 New Comment The ruby docs include a list of the directives. 10:35 AM B Create I S -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
History Comments 2 ruby strftime May 18, 2022 New Comment The ruby docs include a list of the directives. 10:35 AM B Create I S -
@kevin_j_m Solve Direct Problems Started POST "/comments" Processing by CommentsController#create
as TURBO_STREAM Redirected to http://localhost:3000/queries/17 Completed 302 Found in 9ms Started GET "/queries/17" Processing by QueriesController#show as TURBO_STREAM Rendering queries/show.erb Rendered queries/show.erb Completed 200 OK in 6ms -
Mine @kevin_j_m Alluvial Deposit Active Search History Solve Direct Problems
Processing #show as TURBO_STREAM -
@kevin_j_m Solve Direct Problems Started GET "/queries/17" Processing by QueriesController#show
as TURBO_STREAM Rendering queries/show.erb Rendered queries/show.erb Completed 200 OK in 6ms Started GET "/queries/17" Processing by QueriesController#show as HTML Rendering layout layouts/application.html.erb Rendering queries/show.erb within layouts/application Rendered queries/show.erb within layouts/application Completed 200 OK in 6ms -
@kevin_j_m Solve Direct Problems Started GET "/queries/17" Processing by QueriesController#show
as TURBO_STREAM Rendering queries/show.erb Rendered queries/show.erb Completed 200 OK in 6ms Started GET "/queries/17" Processing by QueriesController#show as HTML Rendering layout layouts/application.html.erb Rendering queries/show.erb within layouts/application Rendered queries/show.erb within layouts/application Completed 200 OK in 6ms -
Mine @kevin_j_m Alluvial Deposit Active Search History Solve Direct Problems
Rails turbo stream not rendering layout -
Mine @kevin_j_m Alluvial Deposit Active Search History Solve Direct Problems
Rails turbo render layout -
@kevin_j_m Solve Direct Problems I have a fresh Rails 7
app, and my form isn’t rendering the show action after redirecting. What turbo thing am I missing? gist.github.com/… -
@kevin_j_m Solve Direct Problems I have a fresh Rails 7
app, and my form isn’t rendering the show action after redirecting. What turbo thing am I missing? gist.github.com/… Shout-out to @RogersKonnor. It really helps if the views are *.html.erb, not only *.erb. -
@kevin_j_m Solve Direct Problems Started GET "/queries/17" Processing by QueriesController#show
as TURBO_STREAM Rendering queries/show.erb Rendered queries/show.erb Completed 200 OK in 6ms Started GET "/queries/17" Processing by QueriesController#show as HTML Rendering layout layouts/application.html.erb Rendering queries/show.erb within layouts/application Rendered queries/show.erb within layouts/application Completed 200 OK in 6ms -
@kevin_j_m Solve Direct Problems Started GET "/queries/17" Processing by QueriesController#show
as TURBO_STREAM Rendering queries/show.erb Rendered queries/show.erb Completed 200 OK in 6ms Started GET "/queries/17" Processing by QueriesController#show as HTML Rendering layout layouts/application.html.erb Rendering queries/show.erb within layouts/application Rendered queries/show.erb within layouts/application Completed 200 OK in 6ms -
@kevin_j_m Solve Direct Problems Started GET "/queries/17" Processing by QueriesController#show
as TURBO_STREAM Rendering queries/show.html.erb Rendered queries/show.html.erb Completed 200 OK in 6ms Started GET "/queries/17" Processing by QueriesController#show as HTML Rendering layout layouts/application.html.erb Rendering queries/show.html.erb within layouts/application Rendered queries/show.html.erb within layouts/application Completed 200 OK in 6ms -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Solve
Direct Problems Too many view_component documentation Copy exact issue Start at primary source May 18, 2022 10:48 AM -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Solve
Direct Problems Too many view_component documentation Copy exact issue Start at primary source Rails turbo stream render Take a break Talk to a human May 18, 2022 10:45 AM May 18, 2022 10:48 AM -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
History Comments 2 ruby strftime May 18, 2022 Comments The ruby docs include a list of the directives. 10:35 AM May 18, 2022 10:50 AM -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL app/controllers/queries_controller.rb class QueriesController < ApplicationController def index @queries = Query .all .order(searched_at: :asc) end end history-slowdown ruby Revisit Assumptions -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL app/controllers/queries_controller.rb class QueriesController < ApplicationController def index @queries = Query .all .order(searched_at: :asc) .includes(:comments) end end history-slowdown ruby Revisit Assumptions -
1 2 3 4 5 6 7 8 9 10
11 12 @kevin_j_m NORMAL Gemfile group :development, :test do gem "bullet" end history-slowdown ruby Revisit Assumptions -
Mine @kevin_j_m Alluvial Deposit Active Search History Revisit Assumptions ruby
n+1 bullet alternative -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Revisit
Assumptions ruby n+1 bullet alternative bullet Alternatives | LibHunt ruby.libhunt.com Squash N+1 queries early with n_plus_one_control evilmartians.com 4 Non-standard Ways to Fix N+1 Queries in Rails pawelurbanek.com -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Revisit
Assumptions ruby n+1 bullet alternative bullet Alternatives | LibHunt ruby.libhunt.com Squash N+1 queries early with n_plus_one_control evilmartians.com 4 Non-standard Ways to Fix N+1 Queries in Rails pawelurbanek.com -
@kevin_j_m I Know I Can, But Should I? Evaluating Alternatives
kevinjmurphy.com/railsconf-2019 -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Revisit
Assumptions 1 ruby n+1 bullet alternative May 18, 2022 11:05 AM Expand knowledge base Validate relevant criteria Make intentional choice -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Clear
Search History 1 ruby n+1 bullet alternative May 18, 2022 11:05 AM -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Clear
Clear Search History 1 ruby n+1 bullet alternative May 18, 2022 11:05 AM -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Clear
Clear Search History 0 -
@kevin_j_m Code Review 1 2 3 4 5 class SearchHistory
def self.clear Query.delete_all end end Submit Review -
@kevin_j_m Share Communal Knowledge 1 2 3 class SearchHistory def
self.clear Query.delete_all `delete_all` is a great choice for performance. I’m concerned, because this doesn’t honor `:dependent` rules, that it won’t delete associated records (like comments). Perhaps we start with using `destroy_all` and benchmark the worst-case performance impact? Add Comment B I S Submit Review -
Mine @kevin_j_m Alluvial Deposit Active Search History Share Communal Knowledge
rails delete_all callbacks -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Share
Communal Knowledge rails delete_all callbacks Active Record Relation delete_all api.rubyonrails.org delete_all (ActiveRecord::Relation) apidock.com CollectionProxy `delete_all` and `destroy_all` gist.github.com -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Share
Communal Knowledge rails delete_all callbacks Active Record Relation delete_all api.rubyonrails.org delete_all (ActiveRecord::Relation) apidock.com CollectionProxy `delete_all` and `destroy_all` gist.github.com -
@kevin_j_m Share Communal Knowledge 1 2 3 class SearchHistory def
self.clear Query.delete_all `delete_all` is a great choice for performance. I’m concerned, because this doesn’t honor `:dependent` rules, that it won’t delete associated records (like comments). Perhaps we start with using `destroy_all` and benchmark the worst-case performance impact? Add Comment B I S Submit Review -
Mine @kevin_j_m Alluvial Deposit Active Search History Share Communal Knowledge
rails delete_all vs destroy_all -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Share
Communal Knowledge rails delete_all vs destroy_all CollectionProxy `delete_all` and `destroy_all` gist.github.com Delete vs. Destroy: Does it even matter? medium.com delete_all vs destroy_all ridingwithrails.wordpress.com -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Share
Communal Knowledge rails delete_all vs destroy_all CollectionProxy `delete_all` and `destroy_all` gist.github.com Delete vs. Destroy: Does it even matter? medium.com delete_all vs destroy_all ridingwithrails.wordpress.com -
@kevin_j_m Share Communal Knowledge 1 2 3 class SearchHistory def
self.clear Query.delete_all `delete_all` is a great choice for performance. I’m concerned, because this doesn’t honor `:dependent` rules, that it won’t delete associated records (like comments). Perhaps we start with using `destroy_all` and benchmark the worst-case performance impact? Add Comment B I S Submit Review -
Mine @kevin_j_m Alluvial Deposit Active Search History Share Communal Knowledge
rails dependent options -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Share
Communal Knowledge rails dependent options Active Record Associations - Ruby on Rails Guides guides.rubyonrails.org Rails Dependent Destroy dev.to Rails 6.1 adds support for destroying in background blog.saeloun.com -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Share
Communal Knowledge rails dependent options Active Record Associations - Ruby on Rails Guides guides.rubyonrails.org Rails Dependent Destroy dev.to Rails 6.1 adds support for destroying in background blog.saeloun.com -
@kevin_j_m Share Communal Knowledge 1 2 3 class SearchHistory def
self.clear Query.delete_all `delete_all` is a great choice for performance. I’m concerned, because this doesn’t honor `:dependent` rules, that it won’t delete associated records (like comments). Perhaps we start with using `destroy_all` and benchmark the worst-case performance impact? Add Comment B I S Submit Review -
@kevin_j_m Share Communal Knowledge 1 2 3 class SearchHistory def
self.clear Query.delete_all `delete_all` is a great choice for performance. I’m concerned, because this doesn’t honor `:dependent` rules, that it won’t delete associated records (like comments). Perhaps a middle ground will be using `destroy_all` and changing the comments association to the `:destroy_async` option? We may need to do some benchmarking to test. Add Comment B I S Submit Review -
@kevin_j_m Share Communal Knowledge 1 2 3 class SearchHistory def
self.clear Query.delete_all `delete_all` is a great choice for performance. I’m concerned, because this doesn’t honor `:dependent` rules, that it won’t delete associated records (like comments). Perhaps a middle ground will be using `destroy_all` and changing the comments association to the `:destroy_async` option? We may need to do some benchmarking to test. Add Comment B I S Submit Review -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Share
Communal Knowledge 3 rails delete_all callbacks Technical details May 18, 2022 11:12 AM -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Share
Communal Knowledge 3 rails delete_all callbacks rails delete_all vs destroy_all Introduce alternative Technical details May 18, 2022 11:12 AM May 18, 2022 11:15 AM -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Share
Communal Knowledge 3 rails delete_all callbacks rails delete_all vs destroy_all Introduce alternative Technical details rails dependent options Look at what I learned! May 18, 2022 11:12 AM May 18, 2022 11:15 AM May 18, 2022 11:21 AM -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
Experience 4 Solve Direct Problems Recall Details Revisit Assumptions Share Communal Knowledge -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
Experience 4 Solve Direct Problems Recall Details Revisit Assumptions Share Communal Knowledge Accumulate experience -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
Experience 4 Solve Direct Problems Recall Details Revisit Assumptions Share Communal Knowledge Accumulate experience Utilize experience -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
Experience 4 Solve Direct Problems Recall Details Revisit Assumptions Share Communal Knowledge Accumulate experience Utilize experience Expand experience -
@kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search
Experience 4 Solve Direct Problems Recall Details Revisit Assumptions Share Communal Knowledge Accumulate experience Utilize experience Expand experience Preserve experience -
@kevin_j_m 1 2 3 Alluvial Deposit Active Search History Recall
Details Presentation Resources Browser History Confessional kevinjmurphy.com/browser-history Questions? Hallway Track @kevin_j_m / Twitter twitter.com