A flaky test is a test that is often green, but sometimes red. It may only fail on some PCs, or only when the entire test suite is run.
...JavaScript periodically requests updates from a server to keep a in sync with the latest server-site data. Sometimes the test ended right after a polling request was sent, but...
...project, as a developer you need to follow the following guidelines (e.g. by using something like this issue checklist template). In order to reduce the number of rejects we get...
...from clients, we want to review all code written before it goes to the staging server. Note This process is tailored to our specific needs and tools at makandra. While...
These steps are now part of Spreewald. The step definitions below allow you to test the filename suggested by the server: When I follow "Export as ZIP"
Database connections are not thread-safe. That's why ActiveRecord uses a separate database connection for each thread. For instance, the following code uses 3 database connections: 3.times do
...a new connection end end These three connections will remain connected to the database server after the threads terminate. This only affects threads that use ActiveRecord. You can rely on...
...a request, you want to keep track of how much of the runtime was spent waiting on it, how many calls it took, and the ratio of input to output...
...catches prompt bloat, runaway tool-call loops, and regressions from model changes just by scrolling the log. The same pattern applies to any slow external API you want visibility on...
Sometimes you want to find the inverse of an ActiveRecord scope. Depending on what you want to achieve, this is quite easy with Rails 7, and a bit more complicated...
...with Rails 6 and below, or when the inverse scope may contain NULL values. There are two different ways of "inverting a scope": As an example, consider the following model...
...absence of error end end end Standard validations can be tested with less code The shoulda-matchers gem gives you some RSpec matchers to test the application of standard Rails...
...validations. Under the hood should-matchers uses the same recipe as outlined above (set invalid state, run validations, check for message, etc.), but your tests will have a lot less...
Getting started with Claude Code is super simple. Once you've made yourself familiar with it, you may want to improve your workflow. Here are a few quick tips that...
...are relevant to most users. Keyboard Shortcuts There are lots of keyboard shortcuts. Here are the most relevant ones. Insert a Newline To add a newline without submitting your prompt...
...by default, effectively allowing anyone to upload an unlimited amount of files to your storage. The DirectUploadController from @rails/activestorage bypasses your form controller because it uploads the file using an...
...AJAX request that runs directly, before any form roundtrip happens. This is a comfortable solution to allow in-form uploads with progress, errors etc. Otherwise, the file would be uploaded...
...Saving files to a directory that is not shared between deploys or servers If you save your uploads to a made up directory like "RAILS_ROOT/uploads", this directory goes away...
...after every deploy (since every release gets a new). Also this directory is not shared between multiple application servers, so your uploads are randomly saved to one local filesystem or...
Browsers come with a set of built-in elements like or . When we need a new component not covered by that, we often build it from and tags. An alternative...
...custom element. Custom elements will be ignored during HTML validation, but their children will still be validated. Styling new elements Browsers will give unknown elements a default style of display...
Sentry offers a UI to define custom fingerprint and stack trace rules at https://sentry.io/settings/projects/$project-id/issue-grouping. Fingerprint rules have this syntax: 1 or more key:value conditions, followed by...
...as a wildcard for n characters. Overriding the fingerprint from within the application (with the sentry-ruby gem) You can also set a custom fingerprint from within the application:
git checkout is the swiss army of git commands. If you prefer a semantically more meaningful command for restoring tasks, use git restore instead. With this command you...
... do unstaging - git restore --staged ... discard staged changes - git restore --staged --worktree ... discard unstaged changes - git restore ... restore deleted files - git restore ... restore historic versions - git restore --source
If you need to implement newsletter sending, rapidmail is a solid option. Support is very fast, friendly and helpful, and the initial setup is simple. Since rapidmail works via SMTP...
...you can simply ask the Ops team to configure SMTP credentials for your application. You also do not need to use rapidmail’s built-in newsletter feature. Instead, you can...
The shell variable PS1 holds your bash prompt. You might want to change it to serve your needs best. Here is how to: General non-printing escape sequences in your...
=> ✔ mycomputer ~/projects/platforms master > _ # Arne's epic timestamped prompt with return status indicator and status-colored (green if fresh, or red if unstaged, or yellow if staged) git branch:
...building a web application, one is tempted to claim it "done" too early. Make sure you check this list. Different screen sizes and browsers Desktops, tablets and mobile devices have...
...state while requests are loading. If you cannot implement this for every interaction, focus on slow-loading links and forms. Use Responsive Images to give each user only the image...
Speaker today is Henning Koch, Head of Development at makandra. This talk will be in German with English slides. Introduction As web developers we work with JavaScript every day, even...
...that inherits all properties form User's // child prototype and may then be extended with Student-specific methods. Student.prototype = Object.create(User.prototype) Student.prototype.isEnrolled = function() { return typeof this.studentNumber === 'number' }
Getting parseable output back from an LLM has two halves: shaping the request, then parsing the response. Even with Ollama's format: parameter set, models leak conversational preamble like Sure...
Message types Ollama's chat endpoint takes a messages array with four roles: system, user, assistant and tool. The following message pattern works well for us: one system message...
Hybrid search runs a vector query and a keyword query in parallel against the same documents and merges the two ranked search results. Reach for it once either approach alone...
...performs better with extracted keywords ("parental leave department"), unless you have a very elaborate analyzer (stop-word filter, stemming, language-aware tokenization, etc.). Document and Query Embeddings need different instructions...
...features, this concept might be confusing for developers who have been programming in more static languages, such as Java or C#. This card should help understanding the basic concepts of...
...you might think of a "container" that holds metadata, variables and methods. Metadata describes stuff like the object's class or its object_id which uniquely identifies it. From an...
...to an open redirect vulnerability. Your application's generated route methods with a _url suffix are also affected because they use url_for unter the hood. The problem
...use links with your application's hostname, cause a redirect to evil.tld and present a sign-in form which looks like yours. Users will enter their login credentials and submit...
This raises "Could not find first Keyword": describe Keyword do it { should validate_uniqueness_of(:text) } end Do this instead...
...has a very different disk usage on it's nodes you can use these steps to rebalance the shards. Attention Before we begin it's important to understand how Elasticsearch/OpenSearch...
...defines balance: The balance of the cluster depends only on the number of shards on each node and the indices to which those shards belong. It considers neither the sizes...
When you repeat a subpattern with a *, + or {...} operator, you may choose between greedy, lazy and possessive modes. Switching modes may affect the result and performance of your regular expressions...
...In the worst case, an ill-suited mode may make your regular expression so slow that it can DoS your application (Examples are the ActiveRecord's PostgreSQL CVE...