Today's cameras create huge images, some beyond 50MB. Unless you need to offer this large files, you should always shrink uploaded files to a reasonable resolution. class ImageUploader < CarrierWave...

When you are using the default MIME-Type configuration and your application allows uploading files, it can be a security...

You can use JavaScript to get or set cookie values on the client. Using the vanilla JavaScript API

Rack::SteadyETag was a Rack middleware that generates the same default ETag for responses that only differ in XOR-masked...

A convenient way to test SNS Subscription Filter Policies is using an email address as the subscription endpoint. However, for...

shoelace is a library of web components. Here is a proof of concept how a integration (slightly different as the...

When paginating records, we usually need to know the number of total records in order to render pagination links. Popular...

...found in the official docs, this works just fine. describe Facebook::Post do it_behaves_like :time_series end shared_examples_for :time_series do # shared example code

...means you can use all CSS features that are listed as "This idea is becoming part of the web". Do not use standards in any stage before (like...

makandra dev

Option 1: JSON dump In config/webpack/environment.js you can get inspect environment which includes all webpack config options set for the...

...equal $my-great-blue instead of blue. The reason is that custom property values behave differently and allow any kind of value to be assigned (thus not being bound to...

makandra dev

...lib provides a built-in email regex URI::MailTo::EMAIL_REGEXP. That's the best solution to work with. /\A[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA...

You know each_with_index from arrays: ['hello', 'universe'].each_with_index do |value, index| puts "#{index}: #{value}" end

In case you have trouble with the zeitwerk autoloader, you can check out the documentation Autoloading and Reloading Constants and...

postgresql.org

...them as arrays when you are working with arrays. E.g. bad: WHERE topics @> 'value', better: WHERE topics @> '{value}' Check the PostgreSQL documentation on Array Functions and Operators for more information...

If you have any class which requires access to some path methods generated by your routes. Even though you could...

In our monitoring, RabbitMQ queues like aliveness-test may show up as unresponsive, with a ping timeout after 10 seconds...

tl;dr You can use attribute? as shorthanded version of attribute.present?, except for numeric attributes and associations. Technical Details

github.com

There are a few tools to combat the dreaded n+1 queries. The bullet gem notifies you of missing eager...

It's not possible to change the bwlimit of Proxmox storages via the Web-UI (at least in Proxmox 7...

Within Vim do the following: Move cursor to the first starting line where you want to start editing

video.yahoo.com

Web performance expert Nicole Sullivan discusses a set of best practices in the creation of supremely fast, visually impactful web sites...

...but review your final commit before pushing. Look out for changes that don't belong to your issue (and are usually in place you never touched) when you open a...

makandra dev

...fixed. However, as your frontend adds more JavaScript, AJAX and animations, this test might become "flaky". Flaky tests destroy the trust in your test suite ("I thought this is always...

...before raising NoSuchElementError. This is sufficient for basic, server-rendered application. However, as frontends become more complex (more JavaScript, AJAX requests, animations), race conditions will become too severe to be...