Skip to content

Instantly share code, notes, and snippets.

View rifayetuxbd's full-sized avatar

Md. Rifayet Azam rifayetuxbd

View GitHub Profile
@rifayetuxbd
rifayetuxbd / bootstrap-grid-width-fix.css
Created April 19, 2023 10:36
Set width for grid while using angular material
.container,
.container-fluid,
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm {
--bs-gutter-x: 1.5rem;
--bs-gutter-y: 0;
/* width: 100%; */

API Status codes

/**
 * Object containing all possible HTTP status codes for an API
 */
const API_STATUS_CODES = {
    // 1xx Informational

    /**
@rifayetuxbd
rifayetuxbd / backend-package.md
Last active March 21, 2023 02:24
Starting `package.json` file for creating REST API using Express.js

Starting package.json file for creating REST API using Express.js

{
  "name": "NAME_OF_THE_PROJECT",
  "version": "1.0.0",
  "description": "DESCRIPTION",
  "main": "src/app.js",
  "scripts": {
 "install": "npm i nodemon --save-dev && npm i bcrypt body-parser cors date-fns dotenv express helmet jsonwebtoken lodash multer mysql2",

Create a lazy module using angular CLI

ng g m <module_name> --route <route_name> --module <parent_module_name>

ng g m expense --route expense --module app

Get the current day name

function getCurrentDayName() {
  const currentDate = new Date();
  // 
  // Day must start with monday
  const days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
  const currentDay = days[currentDate.getDay() - 1];
 

Create a highlighter using Angular directive

highlight.directive.ts

import {
  Directive,
  HostBinding,
  Input,
  OnChanges,
  SecurityContext,

Add this to the user snippet (js) to add comment

"Add comment section": {
	"prefix": "comment",
	"body": [
		"/*",
		"* Title: ",
		"* Description: ",
 "* Author: Md. Rifayet Azam Talukder",
@rifayetuxbd
rifayetuxbd / sha256Checksum_of_a_file.md
Last active December 29, 2021 02:32
Get sha256 checksum in any Operating system using command

Get Sha256 Checksum of a File (Windows, Linux, Mac)

LINUX

sha256sum /path/to/file

MAC

shasum -a 256 /path/to/file
@rifayetuxbd
rifayetuxbd / clear_all_css.css
Created December 24, 2021 09:22
Clear all the css property from a element
/* Clear all css property from any element */
button {
all: unset /* This will remove all the css element from the button */
}