Tod is a gem for working with daytimes. That's a tuple of (hour, minute second) without a day, month...

Today's cameras create huge images, some beyond 50MB. Unless you need to offer this large files, you should always...

makandra dev

This is a presentation from 2019-01-21. Summary We want to move away from jQuery in future projects

makandra Curriculum

When your code does not behave as expected, you can use a debugger statement ("breakpoint") at any point in your...

The Ace editor is a great enhancement when you want users to supply some kind of code (HTML, JavaScript, Ruby...

github.com

There are two ways to lock a user in devise. Using the lockable module Customizing the user account status validation...

relishapp.com

When you are using lambdas in RSpec to assert certain changes of a call, you know this syntax: expect { playlist.destroy...

In this example we assume that not only the storage gem changes but also the file structure on disc.

github.com

Masonry is a famous library to dynamically arrange a grid of items that have different aspect ratio, like horizontal and...

developer.mozilla.org

...HTML's accepts a single file. You can allow multiple files via . But sometimes, selecting multiple files is not enough...

Migrating data from a legacy into a new system can be a surprisingly large undertaking. We have done this a...

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...

makandra dev
developer.mozilla.org

Here is how to model basic logic in media queries. AND With keyword and. # Target viewport widths between 500 and...

When you need to store structured data (like Ruby hashes) in a single database column with ActiveRecord, a simple way...

makandra dev

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

github.com

Using the JS fullscreen API is painful because all browers use different methods and events and you need to use...

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

When you find yourself constantly ignoring a RubyMine warning, you can simple disable that warning and de-clutter your editor...

If you have a single node elasticsearch instance and indices with replicas enabled your cluster state will be yellow. If...

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...

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...