React Native, Mac M1 - SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable

At times, you might believe that the ANDROID_HOME value has been correctly set up in the system environment, yet you encounter an error during the build process. To resolve this issue, simply adjust the environment value in the eas.json file, which is incorporated during the build execution. This should rectify the problem.

Changing root folder to /web for Drupal 9/10 in Apache.

When you create a Drupal Project using the composer, it creates two root folders: vendor and web. The web folder contains the developed website, and the vendor folder has dependencies and vendor libraries. When you try to make this website live with the same directory structure, website URL container /web in every URL, which is not a good practice, to remove the /web from the path, you need to tell the Apache server to send all the request to the web folder and web folder must be considered as the root folder for the website.

NodeJS and MongoDB CRUD operations using Mongoose js library

If you are developing API or pages in NodeJS and Using the database MongoDb as storage, here is the example which gives you a getting started code to manage data in MongoDB database from NodeJs code. We will use MongooseJS library, which will work as a Database Layer to communicate with MongoDb. This library has all the required functionality for developing Production-ready applications. We are using ExpressJS to create the routes and to create server-side requests handler. 

Here, we are taking the example of books API where we want to create the CRUD operations.

Tags

Dockerfile to run python

Running the Python project or script in the docker container is relatively easy. You no need to write a huge script. herein an example.

#Deriving the latest base image
FROM python:3.10
#Setting the working directory
WORKDIR /usr/app/src

# Copying the current directory contents into the container at /usr/app/src
COPY . /usr/app/src

# Installing the requirements
RUN pip install -r requirements.txt

RUN pip install poetry
RUN poetry install

# run python script
CMD ["python", "app/main.py"]

 

Tags

ReactJs - Using single state object to handle multiple fields of form

Sometimes you may have seen reactjs form component code where a separate state variable is assigned to separate form fields and a separate onChange handler for each form field. There is no harm in this method, but it creates some extra code in your file which could create a future problem in managing the project.

Python and Segno - Generating QR codes in bulk

As you know, QR code is a graphic or an image having some information hidden within it. This information has some limits in size but mostly allows to store data related communication. QR code can be scanned by a scanner and information gets transferred to that device. It's a very easy and efficient way to quickly transfer information in the device and the device can take appropriate action after scanning is done.

 

Tags

React Native - Using React Navigation

In the Mobile app, we need to navigate between different screens, and each platform has its way of implementation. But in react native, we use the same code base for building a mobile app for all platforms. 

Fortunately, you don't need to write the platform-specific code for creating navigation; it has already been done by someone. We have react-navigation library, which creates navigation for us and handles underlying platform complexities.

Here is a simple example.

Detail Component