Skip to content

Instantly share code, notes, and snippets.

View rifayetuxbd's full-sized avatar

Md. Rifayet Azam rifayetuxbd

View GitHub Profile
@rifayetuxbd
rifayetuxbd / add_gpedit_in_win_10_home.txt
Created December 15, 2021 03:38
Add gpedit in windows 10 home
## Run the flowing command in powershell (run as adminstrator)
Get-ChildItem @(
"C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package*.mum",
"C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package*.mum"
) | ForEach-Object { dism.exe /online /norestart /add-package:"$_" }
@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 */
}
@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

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

"Add comment section": {
	"prefix": "comment",
	"body": [
		"/*",
		"* Title: ",
		"* Description: ",
 "* Author: Md. Rifayet Azam Talukder",

Create a highlighter using Angular directive

highlight.directive.ts

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

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 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
@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 &amp;&amp; npm i bcrypt body-parser cors date-fns dotenv express helmet jsonwebtoken lodash multer mysql2",

API Status codes

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

    /**