Skip to content

Instantly share code, notes, and snippets.

View wh0th3h3llam1's full-sized avatar

wh0am1 wh0th3h3llam1

View GitHub Profile
@wh0th3h3llam1
wh0th3h3llam1 / README-cdx.md
Created May 16, 2019 13:29 — forked from programus/README-cdx.md
Extended windows cd command

CDX Command - CD eXtension batch file

This is a batch file could help you change working directory easier especially you need to change many directories very often like me.

Features

  • Save histroy of all navigated directories
  • No duplicated directories in histroy
  • Name history directories
  • Jump into any directory in histroy by index or name
  • Quich jump into previous directory
  • Maintain history list
@wh0th3h3llam1
wh0th3h3llam1 / colorful_output.bat
Created October 15, 2021 13:36
Colorful output on Python/Bash/Batch/PowerShell
@echo off
echo Gray
echo Red
echo Green
echo Yellow
echo Blue
echo Magenta
echo Cyan
echo White
@wh0th3h3llam1
wh0th3h3llam1 / app-routing.module.ts
Last active March 18, 2022 11:49
Add a `data` property to each path where you require dynamic breadcrumb
const routes: Routes = [
{
path: 'plans',
loadChildren: () => import('./components/plan/plan.module').then(mod => mod.PlanModule),
data: {
breadcrumb: "Plans",
image: "assets/images/planner.svg"
}
},
{
@wh0th3h3llam1
wh0th3h3llam1 / your-component.component.html
Created March 25, 2022 07:07
Basic Static Breadcrumb Code
<div>
<nz-breadcrumb>
<nz-breadcrumb-item>
<a routerLink="/">
<i nz-icon nzType="home"></i>
</a>
</nz-breadcrumb-item>
<nz-breadcrumb-item>
<a routerLink="/university">
<img src="assets/images/university_icon.svg" height="20px" width="20px" alt="">
@wh0th3h3llam1
wh0th3h3llam1 / breadcrumb.interface.ts
Created March 25, 2022 07:13
Breadcrumb Interface
export interface IBreadcrumb {
icon: string,
image: string,
url: string,
label: string,
isClickable: boolean
}
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { IBreadcrumb } from './breadcrumb.interfaces';
import { filter, distinctUntilChanged } from 'rxjs/operators';
@Component({
selector: 'app-breadcrumb',
templateUrl: './breadcrumb.component.html',
styleUrls: ['./breadcrumb.component.css']
<div>
<nz-breadcrumb [nzSeparator]="separatorTemplate">
<nz-breadcrumb-item *ngFor="let breadcrumb of breadcrumbs">
<ng-container *ngIf="breadcrumb.isClickable; else notClickable">
<a [routerLink]="breadcrumb.url">
<ng-container *ngIf="breadcrumb.icon; else noIcon">
<i nz-icon [nzType]="breadcrumb.icon"></i>
</ng-container>
<ng-template #noIcon>
<img [src]="breadcrumb.image" height="20px" width="20px" alt="" *ngIf="breadcrumb.image;">
import { Component, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, ValidatorFn, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { take } from 'rxjs/operators';
import { HttpErrorResponse } from '@angular/common/http';
import { ErrorService } from 'src/app/services/error.service';
@wh0th3h3llam1
wh0th3h3llam1 / keybindings.json
Created April 25, 2022 17:19
VS Code Dotfiles
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+l ctrl+t",
"command": "editor.action.transformToTitlecase"
},
{
"key": "ctrl+l ctrl+l",
"command": "editor.action.transformToLowercase"
},
<form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm(validateForm.value)">
<nz-form-item>
<nz-form-label [nzSpan]="9" nzRequired>Name</nz-form-label>
<nz-form-control [nzSpan]="6" [nzErrorTip]="nameError">
<input nz-input formControlName="name" placeholder="Name" />
</nz-form-control>
<ng-template #nameError let-control>
<ng-container *ngIf="control.hasError('serverError')">
{{ control.errors.serverError }}