mtlynch.io

...boring style violations. When you demonstrate an appreciation for constructive criticism, your reviewer provides better feedback . Make others better: Your code review techniques set an example for your colleagues. Effective...

makandra dev
interfaces.rauno.me

A list of implementation details that make for a better / expected user experience. Have these in mind when implementing a web design. This document outlines a non-exhaustive list of...

makandra dev

While most Rails Apps are tied to at least one external REST API, machine-to-machine communication via GraphQL is...

...in development + test, but keep action_on_unpermitted_parameters = false in production, your application behaves different between these environments. On the other hand it forces to fix these errors in...

...Parameters).to receive(:action_on_unpermitted_parameters).and_return(false) for tests, that should behave exactly like in production...

...file. Note that this is # not guaranteed to be 100% accurate. It performs a "best guess" based # on a simple test of the first +File.blksize+ characters. # # Example: # # File.binary?('somefile.exe') # => true...

If you expect method calls in RSpec 3, be aware that the argument matchers use very liberal equality rules (more...

Same requests are recorded only once in vcr. Replaying a test fails, if you trigger the same request multiple times...

The attached compiler() function below applies JavaScript behavior to matching HTML elements as they enter the DOM. This works like an Unpoly compiler for apps that don't use Unpoly...

...you will sign out your current user whenever you switch to another app. A better way is to use our own daho.im service. All daho.im subdomains resolve to your local...

Simplecov is a code coverage tool. This helps you to find out which parts of your application are not tested...

In long diffs, it can become impossible to spot small changes in larger blocks of moved code. This may be either a method that was moved from the top to...

...update cucumber Make sure you have a recent version of geordi (it doesn't belong in your Gemfile!): gem install geordi Check if you're using Transforms Transform is no...

The sidekiq-rate-limiter gem allows rate-limiting Sidekiq jobs and works like a charm. However, it needs to be...

developer.chrome.com

The File System Access API is a new capability of modern browsers that allows us to iterate over selected folders...

There's a method Integer() defined on Kernel, that typecasts everything into an Integer. Integer("2") # 2 Integer("foo") # Invalid...

Rails 7.1 added the normalizes method which can be used to normalize user input. It lets you define the fields...

tl;dr The :is() pseudo selector - specificity of its most specific argument - matches against a comma-separated list of selectors...

tl;dr The :where() pseudo selector - zero specificity - matches against a comma-separated list of selectors. Example Compound selectors like...

...Capybara see the print stylesheet Capybara always requests as the screen medium. The step belows reloads the current page with a query param we will use in our layout to...

use Postgres' lower() function add an index on lower(email) Probably the best approach is to just convert emails (and usernames) to lowercase within Rails. Popular authentication libraries...

Development environment setup Rails Composer Basically a comprehensive Rails Template. Prepares your development environment and lets you select web server...

Tested on Ubunut 22.04 1. Opener script Create a file ~/.local/bin/coverage_zip_opener with: #!/bin/bash tmp_folder="/tmp/coverage-report-opener" if [ -z "$1" ]

makandra dev

While debugging a SPF record I found spf-record.de to be very helpful. it lists all IPs that are covered by...

...to be performed around a deploy. Be it to notify operations about changed application behavior, be it to run a little oneline script after the deploy. Most database-related stuff...