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-with-spartan.md
Last active July 16, 2024 03:37
Create angular applicaitonwith tailwind css based spartan ui, ngxtension, tanstack

Angular Project setup with spartan

  • pnpm dlx @angular/cli@latest new APP_NAME -s -t --routing --package-manager=pnpm --ssr
  • pnpm add -D @spartan-ng/cli
  • pnpm add @angular/cdk @spartan-ng/ui-core
  • pnpm add -D tailwindcss postcss autoprefixer
  • pnpm dlx tailwindcss init

tailwind.config.js

@rifayetuxbd
rifayetuxbd / emoji-cheatsheet.md
Created June 7, 2024 02:50
Github emoji cheatsheat
@rifayetuxbd
rifayetuxbd / development-checklists.md
Last active June 7, 2024 03:00
Checklist for working on projects - Coding & development, Testing

Coding and Development Plan

Stored procedures/functions are required for all Database access (server side). Client side coding is kept to a minimum and only used if approved by Application Architect and Business Systems Analyst. This is a security measure used to prevent infusion attacks.

All code must be written with the following goals in mind:

1. Maintainability

Adaptable to cope with changing requirements. The following questions will help judge the maintainability code:

  • Can I find the code that is related to a specific problem or change?
  • Can I understand the code? Can I explain the rationale behind it to someone else?
  • Is it easy to change the code? Is it easy for me to determine what I need to change?
  • Can I make a change with only a low risk of breaking existing features?
@rifayetuxbd
rifayetuxbd / utils.ts
Created April 24, 2024 05:06
Next js utils functions under /lib/utils.ts
import { clsx, type ClassValue } from "clsx"
import { customAlphabet } from "nanoid"
import { twMerge } from "tailwind-merge"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
export function generateId(length: number = 16) {
return customAlphabet(
@rifayetuxbd
rifayetuxbd / config.md
Last active April 16, 2024 06:35 — forked from eneajaho/config.md
Angular ESLint & Prettier Configuration

Install Angular ESLint

ng add @angular-eslint/schematics

Install Prettier and Prettier-ESLint dependencies

npm install prettier prettier-eslint eslint-config-prettier eslint-plugin-prettier --save-dev

ESLint configuration

Filename: .eslintrc.json

"use client"

import * as React from "react"
import * as PopoverPrimitive from "@radix-ui/react-popover"

import { cn } from "@/lib/utils"

const Popover = PopoverPrimitive.Root

Loading spin for nextjs

import { cn } from "@/lib/utils"

type LoadingSpinProps = {
  className?: string
  center?: boolean
}
@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:

{