Skip to content

Instantly share code, notes, and snippets.

View rifayetuxbd's full-sized avatar

Md. Rifayet Azam rifayetuxbd

View GitHub Profile
@rifayetuxbd
rifayetuxbd / angular-new-app.md
Last active March 1, 2024 03:35
Create angular application with latest angular cli

Create Angular application with latest CLI

  • Change <APP_NAME>
  • Execute the code in terminal to create a new Angualr Applicaiton
  • CD to <APP_NAME>
pnpm dlx @angular/cli@latest new <APP_NAME> -s -t --package-manager=pnpm --routing --ssr --standalone --strict --style=scss

-s = inline-style

@rifayetuxbd
rifayetuxbd / angular-svg-icon-as-component.md
Created November 17, 2023 05:42
svg icons as Angular component

SVG Icons in Angular component

  • Create directory icons under src/app/icons
  • Download from this gist
@rifayetuxbd
rifayetuxbd / angular.code-snippets.md
Last active April 16, 2024 05:19
Angular code snippets for vscode

Angular snippets

Create a file angular.code-snippets under .vscode/

touch ./vscode/angular.code-snippets

Add below content in it:

{
@rifayetuxbd
rifayetuxbd / material-symbol-icon.md
Last active October 19, 2023 03:40
Use material symbols icon in angular material

Material Symbols icon in Angular Manaterial

  • index.html:

<link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@40,200,0,-25" rel="stylesheet">

  • your.component.ts:

Allow only pnpm

  1. Create .npmrc and include below content at the root of the project
engine-strict = true
  1. Add engines in package.json
@rifayetuxbd
rifayetuxbd / prettier.config.js.md
Last active December 31, 2023 22:54
Prettier config for nextjs application

Prettier config for nextjs applciation

install dev dependencies

pnpm add -D prettier@latest prettier-plugin-tailwindcss@latest @ianvs/prettier-plugin-sort-imports@latest

create file prettier.config.js in root dir

prettier.config.js

@rifayetuxbd
rifayetuxbd / tsconfig-cheat-sheet.md
Created October 12, 2023 06:25
The TSConfig Cheat Sheet

tsconfig.json scares everyone. It's a huge file with a TON of potential options.

But really, there are only a few configuration options you need to care about. Let's figure them out, and cheatsheet them.

Quickstart

Want just the code? Here you go:

{
  "compilerOptions": {
    /* Base Options: */
@rifayetuxbd
rifayetuxbd / semantic-commit-messages.md
Created August 17, 2023 03:04
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@rifayetuxbd
rifayetuxbd / send_file_from_server.md
Created August 8, 2023 06:34
Send file from server

Send file from server

const path = require('path');
        
<ROUTE_NAME>.get(
    '/<API_RROUTE>',
    (req, res) => {

 const filePath = path.join(ROOT_PATH, 'FILENAME');
@rifayetuxbd
rifayetuxbd / create_configure_angular_standalone_with_firebase_emualtor.md
Last active December 26, 2024 20:56
Create and configure angular standalone app with firebase emulators

Create and configure angular standalone app with firebase emulators

Create Angular Standalone App

Create angular standalone app by using command npx @angular/cli@latest new <APP_NAME> --standalone --routing --style=scss

Generate and Update enviroment files

  • Generate environment file for production and devlopment by using command ng g environments
    • It will generate two file environment.ts and environment.development.ts under src/environments/
    • It will update amgular.json file for replacing environment.ts with environment.development.ts for dev version
  • Update environments to below