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.

Jan 17, 2024
While using tfenv tool for using multiple terraform version, we can use TFENV_ARCH variable to set the system architecture. This helps a lot when we need to use terraform amd64 binary on the arm64 device.
eg: to use amd64 binary for terraform 0.14.0, we can use the following command: TFENV_ARCH=amd64 tfenv install 0.14.0
mahesh.bhosle
Mahesh Bhosle
DevOps Engineer
Jan 15, 2024
In Next.js, we can organize our routes into groups without affecting the URL path. This can be done by wrapping a folder's name in parentheses, like (group).

Let's say we have an e-commerce application, we might have different sections like "electronics", and "clothing". Even though these sections have different URLs, we can group them in our code using route groups.

app/
├─ (electronics)/
│ ├─ electronic1/
│ │ ├─ page.tsx
│ ├─ electronic2/
│ │ ├─ page.tsx
├─ (clothings)/
│ ├─ clothing1/
│ │ ├─ page.tsx
│ ├─ clothing2/
│ │ ├─ page.tsx

In this structure, the URL paths will be /electronic1, /electronic2, /clothing1, /closthin2 etc, regardless of the category they belong to.

While route groups don't affect the URL structure, they still allow us to create different layouts for each group by adding a layout.js file inside their folders.
ashwanikumarjha
Ashwani Kumar Jha
Senior System Analyst
Jan 13, 2024
In order to check DNS settings and the resolved IPs, visit about:networking#dns in Firefox
iffyuva
iffyuva
Jan 12, 2024
we can interact with browser events like click on a element in rails using Stimulus
Make sure you have @hotwired/stimulus installed .
Generate a stimulus controller by running the below commands.


./bin/rails generate stimulus controllerName
./bin/rails stimulus:manifest:update


Here , say my controllerName is tooltip , this will create a controller called tooltip_controller.js in app/javascripts/controllers directory & also link the file in app/javascripts/controllers/index.js .

For eg: my functionality is i want to toggle the tooltip visibility so the controller code will look like this


import { Controller } from "@hotwired/stimulus";

// Connects to data-controller="tooltip"
export default class extends Controller {
  connect() {}

  toggleToolTip(event) {
    event.preventDefault();
    this.element.lastElementChild.classList.toggle("hidden");
  }
}


And in your view file we need to wrap our parent div with an attribute called data-controller="tooltip" so the code will look like this


<div class="relative" data-controller="tooltip">
        <%= link_to "#", id: "avatar-link", data: { action: "click->tooltip#toggleToolTip" } do %>
          <%= image_tag(your_image, alt: "Avatar", class: "...classnames") %>
        <% end %>
        <div class="..classnames hidden" id="tooltip-container">
          ... your tooltip contents
        </div>
</div>


so here on click of the image it will toggle the tooltip container , if you take a close look on -> data: { action: "click->tooltip#toggleToolTip" }
this is simply saying perform the click action on tooltip controller using toggleToolTip method defined above.
satya
satya
Jan 8, 2024
AWS DeepLens is a deep learning-enabled video camera designed for developers to get hands-on experience with machine learning. What makes it intriguing is that it brings machine learning capabilities directly to the edge. With DeepLens, you can build and deploy deep learning models on the device itself, allowing it to process and analyze video streams in real-time
nisanth
nisanth
Dec 26, 2023
we need to add chat:write scope in bot token scopes, so that our bot can send messages in the channel when it is mentioned.
Satya
Satya
Dec 26, 2023
with modern Sign in with Slack we need to request the OpenID scopes—openid, email, and profile.
Satya
Satya
Dec 26, 2023
writing integration specs using RSpec and Capybara.
Satya
Satya
Dec 26, 2023
we need to add the user scopes email & profile when we are using the slack openid.connect.userInfo api method.
Satya
Satya
Dec 26, 2023
slack events api performs the events within 3 seconds if any exception happens then it retries again when the app is mentioned again.
Satya
Satya

Showing 30 to 32 of 77 results

Ready to Build Something Amazing?

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