Posts

Angular

Install the latest version of Angular With  node.js  and  npm  installed, the next step is to install the  Angular CLI  which provides tooling for effective Angular development. From a  Terminal  window run the following command:  npm install -g @angular/cli   Project Setup and Generation ng new <project-name> : Creates a new Angular workspace and initial application. Use flags like --routing for routing or --style=scss for SCSS. ng generate (or ng g ): Generates components, services, modules, etc. Examples: ng g component my-component : Creates a new component. ng g service my-service : Generates a service. ng g module my-module : Creates a module. ng g interface my-interface : Generates a TypeScript interface. Commands: ngApp % ng generate --help   ng generate <schematic>              Run the provided schematic.                  ...

Delete Migration and its history

Delete Migration and its history  I f you want to  delete the migration and its history  (so it's like it never existed), do the following: Delete the migration folder: rm   -rf   libs/api/data-access-db/src/lib/migrations/2025070 9143108_update_enums Remove the migration record from the database: If you use Prisma, run this SQL in your database (using  psql  or a GUI): DELETE   FROM   "_prisma_migrations"   WHERE  migration_name  =   '20250709143108_update_enums' ; This will remove the migration from both your codebase and the migration history table.

Set dynamic input fields in React

 Example for Input type text: const [ videoUrls , setVideoUrls ] = useState ([{ id : 0 , url : '' }]) const addVideoField = () => { setVideoUrls ([ ... videoUrls , { id : videoUrls . length , url : '' }]) } const handleVideoUrlChange = ( id , value ) => { const updatedUrls = videoUrls . map ( video => ( video . id === id ? { ... video , url : value } : video )) setVideoUrls ( updatedUrls ) < div id = '' > < Grid container direction = 'row' alignItems = 'normal' spacing = { 4 } sx = { { pl : 5 , pr : 5 , pt : 3 , pb : 2 } } > < Grid item sm = { 12 } sx = { { pl : 5 , pr : 5 , pt : 3 , pb : 2 } } > { videoUrls . map (( field , ...

Commands for setting up and running a development environment

- yarn nx reset: (Resets the Nx cache, which can help resolve issues with stale builds); - yarn cache clean: (Clears Yarn’s cache to ensure that dependencies are freshly installed) - rm -rf node_modules: (Deletes the node_modules and .yarn directories to remove all installed dependencies and Yarn’s internal files) - yarn install: (Installs the project's dependencies from package.json); - yarn db:docker: (Likely starts a database using Docker (e.g., PostgreSQL, MySQL, or MongoDB); - yarn db:up: (Likely brings up the database container if it's using Docker Compose) - yarn db:dev-migrate: (Runs database migrations for the development environment) - yarn start:dev: (Starts the development server)

Clone GitHub repository to SourceTree

Image
To clone a GitHub repository to SourceTree , follow these steps: Step 1: Copy the Repository URL Go to the GitHub (or any Git hosting platform) repository page. Click the green "Code" button. Copy the HTTPS URL (or SSH URL if you have SSH set up). Step 2: Open SourceTree Open SourceTree on your computer. Step 3: Clone the Repository Click on "Clone" from the top menu. In the "Source URL" field, paste the URL you copied. Choose a "Destination Path" (the folder where you want the repo to be saved). Click "Clone" .