...to it if the content inside is too long. While you can only truncate single lines with CSS by using text-overflow, this small JavaScript library also allows truncating text...
...For Internet Explorer, the element you clamp on needs to have its line-height set in pixels. A relative value will not work. There is also the -webkit-line-clamp...
Running Cucumber tests while your cucumber.yml is 100% valid may still produce the following error. cucumber.yml was found, but could not be parsed. Please refer to cucumber's documentation on...
Scope is all about where something is visible. It’s all about what (variables, constants, methods) is available to you at a given moment. If you understand scope well enough...
...more importantly, which ones are not. The article gives detailed explanation on the variable scope in ruby with examples that are easy to understand. Every ruby developer should at least...
If you're getting this strange error message when setting debugging breakpoints, probably HAML is the culprit. Cause As far as I could find out, the error is the result...
...of setting a breakpoint (debugger) in a helper method that's called from a haml partial. Suggestions Try putting the breakpoint into the HAML view...
...of this lesson is to understand what middlewares in Rack are good for. Rack Start with these articles: Rails on Rack Introduction to Rack Middleware Short Screencast to a sample...
...to e.g. a before_filter in ApplicationController? Rails middleware Now look at the middleware stack of a freshly installed Rails application. For each middleware in the stack:
...or quote from an article is duplicated within the article using a different formatting style so that it jumps out at the reader. Blatantly copying the excerpt of the pull...
A pull quote is a purely visual technique, and therefore should not change the structure of the body. Next to that, a structural representation of the excerpt would be seen...
There is a kinda secret, yet well supported CSS feature called currentColor. It's like a special CSS variable that has been supported in almost all browsers for almost all...
...time (see linked Caniuse). Usage The currentColor value can be used in CSS to indicate the current value of color should be used. A common use case is setting a...
...need to test some HTML, e.g. an embed code, you can use RubyMine's "scratch files": File > New Scratch File (or Ctrl + Shift + Alt + Ins) Select "HTML" as file type...
...or paste the HTML Move your mouse to the upper right corner of the scratch file editor. Pick a browser to instantly open your file...
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...
...may want to know the current commit. [1]\ Luckily, there is lots of useful stuff in the .git directory. Commit hash that you are currently applying cat .git/rebase-merge/stopped-sha
...you want to inspect the original commit for its changes, for example like: git show `cat .git/rebase-merge/stopped-sha` Current commit's message cat .git/rebase-merge/message In case you forgot what the changes...
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...
...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 "ü...
We're pleased to announce Ruby 3’s new language for type signatures, RBS. One of the long-stated goals for Ruby 3 has been to add type checking tooling...
...discussion with Matz and the Ruby committer team, we decided to take the incremental step of adding a foundational type signature language called “RBS,” which will ship with Ruby...
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...
With Rspec you can mock objects or functions, for example like this: expect(my_object).to receive(:my_function).and...
SimpleScreenRecorder I recommend simplescreenrecorder, it produces an adequate output with only a few clicks. The audio recording contained some static noises, but that might be caused by my microphone...
...can use the ffmpeg command line tool. In my case, I needed to cut the screen-cast by removing the sequence from 02:36 to 05:23. # Extract the parts...
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
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
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