- Published
- Author
- Vaibhav YadavSenior System Analyst
Local storage does not work right off the bat when we render a web page within an App. App Dev will have to ensure that DOM storage is enable for it to work.
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.
const server = setupServer(
rest.get(`/api/channels/C04UPJ9243E/members`, (req, res, ctx) => {
return res(
ctx.json({
members: [{ name: "Sibtain", image: "abcd.jsp", id: 123 }],
})
);
})
);beforeAll(() => server.listen());
afterAll(() => server.close());afterEach(() => server.resetHandlers());test('render stuff, () => {
}cypress.env.json file to store the environment variables.{
"BASE_URL": "https://company.dev.com/",
"USER_EMAIL": "[email protected]",
"USER_PASSWORD": "Test@12345",
}Cypress.env method in the test file.const baseUrl = Cypress.env('BASE_URL');empty string to the env vars and expose the cypress.env.json file.{
"BASE_URL": "",
"USER_EMAIL": "",
"USER_PASSWORD": "",
}CYPRESS_ prefix to the env vars in the yml file.env:
CYPRESS_BASE_URL: ${{ secrets.BASE_URL }}
CYPRESS_USER_EMAIL: ${{ secrets.USER_EMAIL }}
CYPRESS_USER_PASSWORD: ${{ secrets.USER_PASSWORD }}select sum(size) from pg_ls_waldir(); (Response to the query is in Bytes)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]);
...
};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:Active Record:If-None-Match header with the value of Etag received in previous steprails notescloudflared tunnel --url http://localhost:<PORT>Pick utility allows us to create a new type by picking a subset of properties from an existing type. Instead of duplicating field declarations we can use Pick utility to extract new types.type AdminUser = {
id: number;
name: string;
email: string;
phone: string;
password: string;
age: number;
isAdmin: boolean;
...
}type BasicUser = Pick<AdminUser, 'id' | 'name' | 'email'>;Showing page 23 of 42
AI is everywhere but it's unclear which investments will actually move your metrics and which are expensive experiments.
Most AI projects fail at the data layer. Pipelines, quality, access all need work before LLMs can deliver value.
Your engineers are shipping product. They don't have capacity to also become AI specialists with production-grade experience.
Aging, undocumented codebases make AI integration slow, risky, and expensive. They need to move first.