makandra dev

...below accordingly. Basic idea We will use the guard-livereload gem as the livereload server (which send updates to the browser), use the livereload-js npm package in the browser...

...to connect to the livereload server, not use rack-livereload any more as this is unnecessarily complex and does not work with many CSP policies. We will configure guard-livereload...

...currently running PG version from your Rails application (e.g. Rails console on your production server), simply do this: ActiveRecord::Base.connection.select_value('SELECT version...

...the console, your test may fail after the last step. With unlucky timing the server may receive an AJAX request as the browser tab closes, causing a connection abort when...

...trying to send the response. Since Capybara fails a test if there is a server error this may produce a flaky test. Waiting for pending AJAX requests The following module...

httpie.org

...consists of a single http command designed for painless debugging and interaction with HTTP servers, RESTful APIs, and web services It easy to use and has very nice defaults and...

When you require the Ruby debugger to be available from your Rails console (e.g. you want to inspect a method...

Your development server is usually running on an insecure HTTP connection which is perfectly fine for development. If you need your local dev server to be accessible via HTTPS for...

...to do this again in a month or a year. Next, start your application server for HTTPS. For a Rails application with Puma: bin/rails server -b 'ssl://0.0.0.0:3000?key...

github.com

gem 'capistrano-passenger', require: false Add to your Capfile: require 'capistrano/passenger' Declare which server role should be restarted (optional). Usually passenger tries to restart all servers with the app...

...role. If you have dedicated Sidekiq servers with the app role, adjust the passenger_roles setting to exclude them. set :passenger_roles, :app # This is the default Remove any homegrown...

When running Selenium features with parallel_tests, some browser-server interaction might take longer than usual and the impatient Capybara will not wait enough to see results. Put the attached...

...can churn wildly A big drawback of db/structure.sql is that different developer PCs or servers may create slightly different SQL output. Since this file is rewritten with every migration run...

...Possible reasons for this churn include: Two developers use different versions of the database server (e.g. PostgreSQL 16 vs. 17). Two developers use the same version of the database server...

...always is to prevent long-running queries in the first place, automatic timeouts can serve as a safety net to terminate problematic queries automatically if a set time limit is...

...both databases offer a variable to limit the execution time of queries. While they serve similar purposes they do have some differences in behavior and implementation. PostgreSQL Timeout Type: statement...

matthewphillips.info

...that lets you define "partials" in HTML without any additional rendering technology on the server or client...

We're using Middleman for some static sites like our blog. Despite being very similar to Rails, Middleman does not...

github.com

...alternative to net/http and shares many concepts with WebMock. You can fake a remote server response like this: stub_request(:get, 'http://host/api').to_return(:body => 'fake body')

...install a modern libvips version using our PPA. If you're hosting on makandra servers these packages have already been installed on your application servers. RubyGem In your Ruby code...

To check your apache2 config files for syntax errors run sudo apache2ctl configtest or shorter sudo apache2ctl -t

...esbuild.config.js: external: ['*.ttf'], During the next steps you have to make sure that sprockets serves them correctly and rewrites the paths if necessary. Prepare Sprockets to serve the assets bundled...

...tag and javascript_link_tag to match the new pack names. start the development server with the command bin/dev and check that everything works and looks good. Finish

When your public-facing application has a longer downtime for server maintenance or long migrations, it's nice to setup a maintenance page to inform your users. When delivering the...

...for maintenance pages The best HTTP status code for your maintenance page is "503 Service Unavailable": The server is currently unable to handle the request due to a temporary overloading...

Unless you changed the default, this will be 16 MB: mysql> SHOW VARIABLES WHERE Variable_name="max_allowed_packet"; +--------------------+----------+

ng-newsletter.com

Search engines, such as Google and Bing are engineered to crawl static web pages, not javascript-heavy, client-side apps...

developer.rackspace.com

...connection usually takes only a few seconds, but if you’re connecting to a server multiple times in succession the overhead starts to add up. If you do a lot...

...of Git pushing and pulling or frequently need to SSH to a dev server, you’ve probably felt the pain of waiting for SSH to connect so you can get...

makandra dev

...sometimes outside of our control. For example, on one of our bigger projects, our servers are on a denylist for all of Microsoft's cloud e-mail (like @outlook.com) for...

...were rejected. We then started to send out e-mails via Amazon's SES service, only to discover that we were now blocked by several German providers like @web.de.

You need to install the following packages before you can build the Paperclip gem: sudo apt-get install imagemagick librmagick...

makandra dev
rawgit.com

RawGit serves raw files directly from GitHub with proper Content-Type headers, for CDN-like purposes. Note that they don't offer any uptime guarantee. You probably don't want...

...to use it in production, but it may serve you well for some testing/prototyping/etc...

You won't usually have to do this. It's OK to route all formats to a controller, and let...