Skip to content

Instantly share code, notes, and snippets.

View patrickclery's full-sized avatar

Patrick Clery patrickclery

View GitHub Profile

How to split technical tasks so that every developer can work asynchronously

Mock-Driven Development is a way of planning out features in a way that allows each dev to work on a feature without having to wait for other coders to finish their work.

The traditional way of assigning tasks

  • The coder is given a business requirement and told "make this happen".
  • Because the business scope might be vague, the technical scope becomes a big question mark.
  • This often makes the scope of the feature cross several domains of the app (backend, frontend, API, database, etc.)
  • By the end of the feature, the coder is expected to have all these domains working together without errors.

Best Practices for Debugging

Big Principle #1: Use the same data

Scientific control

A scientific control is an experiment or observation designed to minimize the effects of variables other than the independent variable. This increases the reliability of the results, often through a comparison between control measurements and the other measurements.

~Wikipedia

@patrickclery
patrickclery / how-to-create-a-rubocop-keymap-in-rubymine.md
Last active February 1, 2023 11:47
How To Create A Rubocop Keymap In Rubymine

How To Create A Rubocop Keymap In Rubymine

  1. Go to Settings > Tools > External Tools

Screenshot_20211014_145200

  1. Click "+" to add a new tool. Copy the details below, (replace /home/patrick/bin with /home/<YOUR_USER>/bin)

Screenshot_20211014_145017

[patrick@vision ~]$ ssh blackwidow -v
OpenSSH_8.6p1, OpenSSL 1.1.1k 25 Mar 2021
debug1: Reading configuration data /home/patrick/.ssh/config
debug1: /home/patrick/.ssh/config line 1: Applying options for *
debug1: /home/patrick/.ssh/config line 14: Applying options for blackwidow
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to blackwidow.lexop.com [52.138.33.195] port 22.
^C
[patrick@vision ~]$ ssh rogue -v
OpenSSH_8.6p1, OpenSSL 1.1.1k 25 Mar 2021
@patrickclery
patrickclery / test.log
Created June 11, 2021 03:13
test/models/payment_agreement_test.rb fails (possibly due to after 7pm)
Failure:
PaymentAgreement::#agreement::payment from frontend::fails#test_0001_does not send an email [/home/circleci/project/app/models/debt.rb:302]
Minitest::Assertion: unexpected invocation: #<AnyInstance:PaymentAgreement(id: uuid, debtor_id: uuid, duration: integer, frequency: integer, start_date: datetime, end_date: datetime, status: string, deleted_at: datetime, created_at: datetime, updated_at: datetime, organization_id: uuid, first_payment_amount: decimal, average_payment_amount: decimal, items_count: integer, payment_method_id: uuid, base_start_date: datetime, status_changed_at: datetime, debt_id: uuid)>.send_agreement_message()
unsatisfied expectations:
- expected never, invoked once: #<AnyInstance:PaymentAgreement(id: uuid, debtor_id: uuid, duration: integer, frequency: integer, start_date: datetime, end_date: datetime, status: string, deleted_at: datetime, created_at: datetime, updated_at: datetime, organization_id: uuid, first_payment_amount: decimal, average_payment_amount: decimal, items_count:
@patrickclery
patrickclery / how-to-design-a-full-stack-feature-in-pairs.md
Last active May 14, 2021 02:13
How to design a full stack feature in pairs

How to design a full stack feature in pairs

How to work on frontend/backend without relying on each other's work

STEP 1: Define how the request/response flow works between the frontend at every step.

The Problem: One common issue that can arise is a form needs to be designed before the backend can test their controller... OR an API endpoint on the backend needs to be functioning before a frontend can test if their request works.

If you're building a backend feature, for example a Webhook for the Twilio API, then you can go into their Dashboard, test your webhook, and you don't have to worry about this kind of thing.

# 2020-03-03 Organization Sent this message by Campaign ABC: "You owe $66" <-- this is the
# "campaign message" object
#
# 2020-03-05 Debtor said: "Hey there - I paid this online yesterday"
#
# 2020-03-05 conversation marked as "requires attention". <-- could be hidden/implied and not
# shown
#
# 2020-03-06 Organization said: "We received the update, thanks! Will mark this as resolved."
# ^^^ "campaign message" object, this is just a "reply".
@patrickclery
patrickclery / karabiner.json
Created December 12, 2020 03:59
karabiner keys for Magnets MacOS
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
/bin/bash -c "/Users/patrick/.rvm/bin/rvm ruby-2.7.1@Lexop do /Users/patrick/.rvm/rubies/ruby-2.7.1/bin/ruby /Users/patrick/Projects/lexop/bin/rails 'data:migrate'"
warning: parser/current is loading parser/ruby27, which recognizes
warning: 2.7.2-compliant syntax, but you are running 2.7.1.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
**************************************************
⛔️ WARNING: Sidekiq testing API enabled, but this is not the test environment. Your jobs will not go to Redis.
**************************************************
== 20200818192252 CopyDebtorsToDebt: migrating ================================
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
@patrickclery
patrickclery / patrickclery.md
Last active January 6, 2024 15:39
The professional resume of Patrick Clery, Ruby on Rails Developer.

PATRICK CLERY - Ruby on Rails Developer

I'm a freelance web developer of over twenty years who builds single-page apps using Ruby on Rails & React.JS.

Whether you're looking to start a new project, add features to an existing one, or add an experienced developer to your team -- I can do it.