This is an attempt to list some of those things: On the server Always optimize: Don't do stupid things with the database. Avoid "n + 1" queries. Don...
...complicated table, or crazy visualization in a separate AJAX call? Move work from the server to the client. On the client The biggest issue on the client are loading times...
...current date in their name, like access.2011-04-20.log, without any need to restart the web server every night (like logrotate does). The last argument above is the rotation time in seconds...
...minutes with a custom shell script. Be advised that in that time frame a server crash (or reboot, if not taken care of) means that those in-memory log files...
}); Generating a PNG To save the signature as a png on the server, add this to your model (example with Paperclip): class Signature < ActiveRecord::Base HEIGHT = 160
If you specify different ports, you can run multiple local webricks with rails server --port=300X at the same time...
...applications can be used by multiple users at the same time. A typical application server like Passenger has multiple worker processes for a single app. In a distributed deployment setup...
...like we use at makandra you will even have multiple application servers, each with their own worker pool. This means that your code needs to deal with concurrent data access...
...have a piece of code that tries to send a request to a remote server. Now the server is temporarily not available and raises an exception. In order to re...
...to slow or offline, you can also read a gem documentation offline. Start a server with gem server and go to http://0.0.0.0:8808/. Here you will find a list...
I had trouble serving an MP4 video to my iPad. Although the video complied with all the specs (H.264 codec, up to 1080p, 30 FPS) I always got this error...
...This video could not be loaded, either because the server or network failed or because the format is not supported: http://10.40.0.177:3000/video.mp4 After spending a lot of time fighting...
...checks in Thunderbird. Open Edit -> Account settings and select your incoming mail account. Under Server settings uncheck "Check for new messages on startup" and "Check for new messages every X...
Under Advanced, uncheck "Use IDLE command if the server supports it...
...s -> staging, m -> makandra), bundle if needed, check the selected stage exists Improve geordi server: Takes port as argument (e.g. geordi ser 3001), option --public (-P) starts the server with...
...cucumber, rspec), as rake usually runs all employed tests Rename geordi devserver to geordi server (the former is still supported) Improved command descriptions and README Fix geordi firefox --setup: Fail...
...what happens: For drivers like Selenium, Capybara will boot up a Thin or Webrick server in a separate thread. It then makes a GET request to /__identify__ to see if...
...the server is ready to accept requests. Since you don't have a route that responds to /__identify, Capybara will wrap your Rails app in a middleware that responds to...
The attached article outlines considerations when choosing client-side vs. server-side implementations of the Google Geocoding APIs (geocoder, directions, not maps drawing). The main points are:
...client side the quota is per-client, so basically unlimited When implementing APIs on the server-side, be aware that quota is measured by IP. When hosting in the cloud...
...to offer your users a live preview before they upload the file to the server. HTML5 via jQuery Luckily, HTML5 has simple support for this. Just create an object URL...
...Problem can occur when using the integrated Ruby Mine Debugger: Try to restart the server without debugging mode
...malicious users can upload executables (like an .exe or .scr file) and use your server to distribute it. However, modern operating systems usually warn before executing files that were downloaded...
...be spoofed. When the user later accesses a file upload via an URL, the server will choose a Content-Type header based on the file's extension, regardless of what...
...seriously speed up deployments with Capistrano when using a local git repository on the server you are deploying to. Simply add set :deploy_via, :remote_cache set :copy_exclude, [ '.git...
Host: www.example.com The application/xml accept header might lead to unexpected results on your server. You can force REST Client to ask the server for default text/html that way: RestClient.get...
If you want to make your Rails application be capable of sending SMTP emails, check out the action mailer configuration...
...language when they visit the root path. Here is how to do it without a server-side component (like a Rails application). Use JavaScript's navigator.language (real browsers and IE11...
require_relative "../config/boot" require "active_support/continuous_integration" ActiveSupport::ContinuousIntegration.run do step "Setup", "bin/setup --skip-server" step "Security: Rubygems audit", "bundle", "audit" step "Security: NPM audit", "npm", "audit" step "Security: Importmap...
require_relative "../config/boot" require "active_support/continuous_integration" ActiveSupport::ContinuousIntegration.run do step "Setup", "bin/setup --skip-server" step "Style: Ruby", "bin/rubocop" step "Style: JS", "npx prettier", ".", "--check" step "Style: CSS", "npx stylelint...
Connect to your memcached host. (AWS elasticache is memcached) telnet foohost23.cs2631.0001.euw1.cache.amazonaws.com 11211 Once you're connected, find out which 'slabs...
...distinct version of RubyGems to be installed to replicate the same behavior across multiple servers. Usually would do this to update your RubyGems, but this always takes you to the...
This tool is used on our application servers (and called when deploying) but it also works locally. Just call dumple development from your project directory to dump your database.
...added to your project and your Apache2/Passenger only replies with an Error 500 (Internal Server Error) you won't get any love from both application and Apache logs.
...there. It should also fail but you will most likely see this error: Internal Server Error undefined method `new' for "Rack::Bug":String While the following is (for some reason...