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.

Jun 23, 2023
If Postgres logical replication is enabled via pglogical extension, below query can be used to check the size WAL Folder.
select sum(size) from pg_ls_waldir(); (Response to the query is in Bytes)

This is the folder where the WAL logs are stored, which is utilized for postgres data replication from master to slave. In case there is any lag or problems with replication the logs will get accumulating in the folder, spiking the disk storage and can cause downtime of the database it self.
ananth
Ananth
Jun 22, 2023
In the first server-side rendering (SSR) page render, the router.query may not be populated immediately. To handle this scenario, we can add a check to ensure that the redirection happens only on the client-side, once the router.query values are available.



import { useEffect } from 'react';
import { useRouter } from 'next/router';

export const ResetPasswordPage = () => {
  const { push, query, isReady } = useRouter();
  const { username, code } = query as ResetPasswordPageQuery;
   ...
  useEffect(() => {
    if (isReady && (!username || !code)) {
      push('/login');
    }
  }, [isReady, username, code, push]);
  ...
};


Here the isReady property from useRouter is used to determine if the router is ready and router.query is populated.
This way, the initial SSR render won't trigger the redirection, and the user will be redirected to the login page only on the client-side if the necessary parameters are missing from the URL.
ashwanikumarjha
Ashwani Kumar Jha
Senior System Analyst
Jun 16, 2023
Tools discussed in todays session
1. https://ethereal.email/ - Email Testing
2. https://github.com/danmayer/coverband - Clean Up Legacy Unused Code
3. https://posthog.com/ - Product Analytics
4. https://miro.com/ - Collaboration Tool
ananth
Ananth
Jun 16, 2023
Open PR from CLI
• brew install hub
• git config --global hub.protocol https
• hub pull-request (Will create PR for the current branch)
sujay
Sujay
Jun 12, 2023
Term called fuzzy searching
fuzzy searching (more formally known as approximate string matching) is the technique of finding strings that are approximately equal to a given pattern (rather than exactly).
ayushsrivastava
Ayush Srivastava
System Analyst
Jun 6, 2023


I learned how to use promise.all to combine multiple api calls.
Learned how to made api endpoint by using app directory and page directory in Next Js.

Learned how to implement slack bolt app with next js using the bolt http runner npm package

Learned how to use node-cron to schedule message

rishav.raj
Rishav Raj
System Analyst
Jun 3, 2023
The Active Record Pattern popularised by Ruby on Rails goes against the modularity provided by Nest.Js.

Nest.js encourages the use of the Repository pattern.

Data Mapper/Repository pattern:

• Separates data access logic from business logic
• Data Mapper: Maps data between domain objects and the database
• Repository: Provides methods for querying and manipulating domain objects
• Promotes separation of concerns, testability, and maintainability
Active Record:

• Combines data access and business logic within domain objects
• Domain objects encapsulate database interactions
• Simplifies development by allowing direct manipulation of objects
• Can make separation of concerns and independent testing more challenging
ashwanikumarjha
Ashwani Kumar Jha
Senior System Analyst
Jun 1, 2023
Etag HTTP Header
- Etag (also known as entity tag) is a unique identifier for a resource
- This is used to cache the resources that are unchanged
- When a request is recieved by server, it generates response and attaches Etag
- In the subsequent request, application requests for the same resource with If-None-Match header with the value of Etag received in previous step
- Server compares the value of If-None-match header with Etag identifier value on server
- If the values match server responds with 304(Not modified) status code with the empty body
- Application can use the cached response
sujay
Sujay
Jun 1, 2023
Get all TODO comments in rails application using rails notes
sujay
Sujay
May 31, 2023


1. Learned how to use the slack api.
2. Learned how to send message on user command through the slack bot.
3. Learned how to setup and use incoming web hook for slack bot.
4. Learned How to post message in channel using the incoming web hook.
5. Learned how to do post req using the axios.
rishav.raj
Rishav Raj
System Analyst

Showing 44 to 46 of 82 results

Ready to Build Something Amazing?

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