Rails defines a #truncate helper as well as a method String#truncate. = truncate("my string", length: 5) = "my string".truncate...

makandra dev
litmus.com

The 90s are calling: they want their tables back. Unfortunately, you need them all for laying out your HTML emails...

stackoverflow.com

Ruby has this handy block shortcut map(&:to_i) for map { |x| x.to_i }. However, it is limited to argument...

makandra dev

Authentication is a special part of web applications. On the one hand, it usually is a crucial security mechanism restrict...

developer.mozilla.org

Browsers' printing methods usually don't print background colors. In most cases this is the desired behavior, because you don...

guides.rubyonrails.org

TL;DR Append your locale keys with _html to have them marked as html_safe and translate them with = t...

When your application is running on a multi-server setup, application logs are stored per server (unless you choose a...

When your JavaScript bundle is so massive that you cannot load it all up front, I would recommend to load...

You know that you can use jQuery's text() to get an element's contents without any tags.

For outputting a given String in HTML, you mostly want to replace line breaks with or tags.

Lets say we have a user with a contract whereas contract is a mounted carrierwave file. Now we want to...

github.com

This might be a known issue with Rubygems 2.5.1. This will help: gem update --system

jsfiddle.net

When you need test images, instead of using services like lorempixel or placehold.it you may generate test images yourself.

Boot partitions from installations prior to the 16.04 era are terribly small. When you install updates and encounter errors due...

makandra dev
github.com

geordi delete_dumps [directory] Recursively search for files ending in *.dump and offer to delete those. When no...

api.rubyonrails.org

Rails offers a way to prepend (or append) view paths for the current request. This way, you can make the...

When you have string contents (e.g. a generated binary stream, or data from a remote source) that you want to...

Form fields can be rendered as noneditable by setting the disabled or the readonly attribute. Be aware of the differences...

Trying to open a vnc window with geordi geordi vnc ended up with this error: > VNC viewer could not be...

stackoverflow.com

mysql> SELECT @@global.version; +------------------+ | @@global.version | +------------------+ | 5.6.30 | +------------------+ 1 row in set (0,00 sec) MySQL 5.6 Reference Manual says "BLOB and TEXT...

If you want to make a screenshot of a website that works well in print or on a high-DPI...

makandra dev

When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use...

about-payments.com

About-Payments is here to help you to accept payments online and find the best payment service provider for your...

TL;DR Use user.update!(remove_avatar: true) to delete attachments outside of forms. This will have the same behavior as...