TILs - Fueling Curiosity, One Insight at a Time

At Codemancers, we believe every day is an opportunity to grow. This section is where our team shares bite-sized discoveries, technical breakthroughs and fascinating nuggets of wisdom we've stumbled upon in our work.

Published
Author
user-image
Revath
use flex: 1 on the child of flexbox element to expand the child to 100% width of the parent https://jsbin.com/dadidujubo/1
Published
Author
user-image
Akshay
Capybara defaults to requiring an href attribute exist when finding links. To handle such cases we can pass href: nil as an option thus enabling to find it.
Published
Author
user-image
Akshay
Rails has an ActiveSupport::Notifications module which is a part of its core instrumentation API. This API allows users to define hooks on events. With the ActiveSupport::Notifications you can instrument an event by simply calling instrument with a name, payload and a block. The notification will be sent after the block returns. Now all you need is to define subscribe method which consumes the event based on event name and you can define your on callback code here, sort of like a Pub/sub pattern.
Published
Author
user-image
Goromlagche
you can pass options.args << ‘--headless’ to firefox newer versions, no need for headless gem

options = Selenium::WebDriver::Firefox::Options.new
options.args << ‘--headless’
Capybara::Selenium::Driver.new(app,browser: :firefox, options: options)
Published
Author
user-image
Iffyuva
To remove unwanted hex packages from mix.lock file, use mix deps.unlock --unused command
Published
Author
user-image
Emil
You can switch between k8s contexts using the docker toolbar menu in OSX.
Published
Author
user-image
Akshay
React provides us with Portals which can be used to render children into a DOM node that exists outside the DOM hierarchy of the parent component

Showing 63 to 65 of 82 results

Ready to Build Something Amazing?

Codemancers can bring your vision to life and help you achieve your goals