Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Browser History Confessional: Searching My Recent Searches

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
Tweet

More Decks by Kevin Murphy

Other Decks in Technology

Transcript

  1. @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
  2. @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
  3. @kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search

    History 2 how to give a good presentation Kevin Murphy
  4. @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
  5. 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
  6. 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
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. @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
  13. @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
  14. @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
  15. 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
  16. 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
  17. @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
  18. @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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. @kevin_j_m Solve Direct Problems > rails test # Running Error:

    DateTimeComponentTest#test_displays_the_formatted_date: NoMethodError: undefined method `l_datetime' for #<DateTimeC
  26. @kevin_j_m Solve Direct Problems > rails test # Running Error:

    DateTimeComponentTest#test_displays_the_formatted_date: NoMethodError: undefined method `l_datetime' for #<DateTimeC
  27. @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
  28. @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
  29. 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
  30. 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
  31. @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
  32. @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
  33. @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
  34. @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
  35. @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
  36. @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
  37. @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/…
  38. @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.
  39. @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
  40. @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
  41. @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
  42. @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
  43. @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
  44. @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
  45. 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
  46. 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
  47. 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
  48. @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
  49. @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
  50. @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
  51. @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
  52. @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
  53. @kevin_j_m Code Review 1 2 3 4 5 class SearchHistory

    def self.clear Query.delete_all end end Submit Review
  54. @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
  55. @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
  56. @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
  57. @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
  58. @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
  59. @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
  60. @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
  61. @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
  62. @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
  63. @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
  64. @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
  65. @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
  66. @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
  67. @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
  68. @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
  69. @kevin_j_m Alluvial Deposit Active Search History Search History Searches: Search

    Experience 4 Solve Direct Problems Recall Details Revisit Assumptions Share Communal Knowledge
  70. @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
  71. @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
  72. @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
  73. @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
  74. @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