If your shell seems frozen You probably pressed Ctrl-S which stops the buffer. Try Ctrl-Q to resume. If your shell behaves strangely (no input being displayed, strange character...
...Try typing this, followed by pressing the return key: reset That should clear the screen and reset output settings etc...
Styling HTML email is painful. Tables, inline CSS, unsupported CSS, desktop clients, web clients, mobile clients, various devices, various providers. All these things have to be thought about and tested...
...It’s no surprise developers don’t want to deal with this when there is a backlog of more important priorities. We’ve tried to remove some of the pain...
...so ETags are only saving you render time and some bandwidth. While working on a Sinatra-based JSON web service that gets very heavy traffic, I wanted to find a...
...way to short-circuit requests and avoid most of the stack if a resource hasn’t been modified...
Katapult was an endeavor to dramatically speed up starting a new Rails application. However, it turned out to save less time than expected, while requiring more time for maintenance than...
...anticipated. Since its benefits fell too low, we have decided to not continue developing Katapult. You can still use Katapult for generating ready-to-run applications with model CRUD, authentication...
While you can set your own font in your terminal or other tools, it will not change the default "Monospace" font that some applications use. To change that, edit ~/.fonts.conf...
...and add settings for the "monospace" family. Here is how it looks on my machine now: monospace DejaVu Sans Mono Fill in "DejaVu Sans Mono" with your preferred font's...
Get "PuTTY Link" and "Pageant" (an SSH key agent) from the PuTTY download page. Run pageant.exe, find its icon inside your system tray and add your SSH key.
...a cmd and put the full path to PuTTY's plink.exe into the GIT_SSH environment variable, e.g.: set GIT_SSH=D:\PuTTY\plink.exe You can then use Git like...
...the parsing to ruby_parser. Unfortunately, ruby_parser appears to be confused when a string contains both escaped chars (that is, any unicode characters as ndash, umlauts etc.) and #{} blocks...
...which makes it extremely slow. The easiest "solution" we came up with was to replace all occurrences of UTF-8 chars with their HTML entities (so "ü" instead of "ü...
...write this instead: expect(value).to eq(true) expect(value).to eq(false) See also RSpec claims nil to be false
If you need to call a state_machine event and do not want to re-define resource_controller's create method, try this: create.before do object.state_event = :launch_spaceship
Richard Powell presents a collection of CSS styling advice that's mainly taken from SMACSS. Although at makandra we're using BEM instead of SMACSS, here's my favorites.
...not use ID's in CSS Selectors It is never safe to assume there will only ever be one of something on a page so do not use ID's...
This only works when you actually have a session ID (not the case for Rails' CookieStore, for example): request.session_options[:id] # => "142b17ab075e71f2a2e2543c6ae34b94" Note that it's a bad idea to...
...expose your session ID, so be careful what you use this for...
If you want to do JavaScript-style camelization, ActiveSupport's String#camelize method can actually help you out. Simply pass a :lower argument to it. >> 'foo_bar_baz'.camelize
You select some characters, make them bold and suddenly your entire document is bold? Here's how to fix that: Right-click the style in the "Styles and Formatting" window...
...Select "Modify" Go to the "Organizer" tab Unselect "AutoUpdate" You're welcome...
...our app(s). In the beginning, there was the monolithic Rails app in the standard way with 100+ models and their many corresponding controllers and views. Then we moved to...
...between the (initial) straightforwardness of the single Rails app and the modularity of the more service-oriented architecture...
Pdfposter is a Python script that allows to convert large PDFs into a PDF with multiple pages that can be printed and turned into one big poster. In Ubuntu, you...
...can install it with sudo apt-get install pdfposter Scaling to the desired size is a bit cumbersome. If you want to split large.pdf, I suggest you run pdfposter -vns...
You can use gem list to list all gems available from a remote gem server: gem list -r --clear-sources -s 'https://user:password@gemserver.tld/' This is useful to debug cases...
...where Bundler complains of a gem existing in more than one gem source...
Because systemd is the greatest thing ever it's not enough to stop the libvirt service. You need to disable the libvirt socket too. sudo systemctl stop libvirt-bin
...systemctl stop libvirt-bin.socket sudo systemctl start libvirt-bin
You may omit the /path/to/link_name to have a link with the same filename appear in the current directory
It's that simple to allow one of your Linux users to run a single command as UID 0: sudo visudo Add the line below to allow user 'deploy' to...
There is a bug in Rails 3's dbconsole script, which makes the following command open a database console for the development environment: rails dbconsole -p test
...that you want to provide default views for a group of controllers. Let’s say you have a bunch of controllers inside the Admin namespace and you would like each...
...action for Admin::PostsController and “app/views/admin/posts/index.html.*” is not available, it should then render “app/views/admin/defaults/index.html”. Since Rails 3.0, we have a new abstraction called resolvers that holds the logic to find...
This will reduce the filesize of foo and bar to 0 bytes: truncate -s0 foo bar If the files do not exist they will be created. You can use this...
...to easily truncate your application's log files: truncate -s0 log/*.log
...have to write an HTML message for some weird reason. Here is how: Hold the Shift-Key while clicking on "Write", "Reply", "Reply All", or "Forward".
...the following way: if object is a block, it converts the block into a simple proc. if object is a Proc, it converts the object into a block while preserving...
...the lambda? status of the object. if object is not a Proc, it first calls #to_proc on the object and then converts it into a block...