Skip to content

Instantly share code, notes, and snippets.

View melkorCBA's full-sized avatar
:shipit:
Focusing

Chatura Bashika melkorCBA

:shipit:
Focusing
  • Colombo, Sri Lanka
View GitHub Profile
@melkorCBA
melkorCBA / grokking_to_leetcode.md
Created June 23, 2022 06:36 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@melkorCBA
melkorCBA / modal.component.html
Created October 26, 2020 14:12
modal template V5
<app-backdrop (backdropClicked)="closeModal()"></app-backdrop>
<div cdkDrag class="modal">
<div #resizeBox class="modal-box">
<span #dragHandleCorner class="dragHandle corner" cdkDrag
(cdkDragMoved)="dragMove(dragHandleCorner, $event)"></span>
<span #dragHandleRight cdkDragLockAxis="x" class="dragHandle right" cdkDrag
(cdkDragMoved)="dragMove(dragHandleRight, $event)"></span>
<span #dragHandleBottom cdkDragLockAxis="y" class="dragHandle bottom" cdkDrag
(cdkDragMoved)="dragMove(dragHandleBottom, $event)"></span>
@melkorCBA
melkorCBA / backdrop.component.ts
Created October 26, 2020 14:11
backdrop component
import { Component, EventEmitter, OnInit, Output } from '@angular/core';
@Component({
selector: 'app-backdrop',
templateUrl: './backdrop.component.html',
styleUrls: ['./backdrop.component.scss']
})
export class BackdropComponent implements OnInit {
@Output() backdropClicked = new EventEmitter();
@melkorCBA
melkorCBA / modal.component.html
Created October 26, 2020 14:08
modal template V4 - resizble
<div cdkDrag class="modal">
<div #resizeBox class="modal-box">
<span #dragHandleCorner class="dragHandle corner" cdkDrag
(cdkDragMoved)="dragMove(dragHandleCorner, $event)"></span>
<span #dragHandleRight cdkDragLockAxis="x" class="dragHandle right" cdkDrag
(cdkDragMoved)="dragMove(dragHandleRight, $event)"></span>
<span #dragHandleBottom cdkDragLockAxis="y" class="dragHandle bottom" cdkDrag
(cdkDragMoved)="dragMove(dragHandleBottom, $event)"></span>
<div class="modal-header">Modal Header</div>
@melkorCBA
melkorCBA / modal.component.html
Created October 26, 2020 14:06
modal template V2 - with drag
<div cdkDrag class="modal" cdkDrag>
<div class="modal-header">Modal Header</div>
<div class="modal-text">Lorem ipsum dolor sit amet.</div>
<div class="modal-buttons">
<button (click)="closeModal()">Yes</button>
<button (click)="closeModal()">Cancel</button>
</div>
</div>
</div>
@melkorCBA
melkorCBA / modal.component.html
Created October 26, 2020 14:03
Modal component tamplete V2
<div cdkDrag class="modal">
<div class="modal-header">Modal Header</div>
<div class="modal-text">Lorem ipsum dolor sit amet.</div>
<div class="modal-buttons">
<button (click)="closeModal()">Yes</button>
<button (click)="closeModal()">Cancel</button>
</div>
</div>
</div>
@melkorCBA
melkorCBA / modal.component.ts
Created October 26, 2020 13:59
Modal component class V1
import { Router } from '@angular/router';
import { Component, OnInit, ViewChild, ElementRef, AfterViewInit, NgZone } from '@angular/core';
import { CdkDragMove } from '@angular/cdk/drag-drop';
@Component({
selector: 'app-modal',
templateUrl: './modal.component.html',
styleUrls: ['./modal.component.scss']
})
export class ModalComponent implements OnInit, AfterViewInit {
@melkorCBA
melkorCBA / app.module.ts
Created October 26, 2020 13:54
App Module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { NavbarComponent } from './navbar/navbar.component';
import { LandingComponent } from './landing/landing.component';
import { ModalComponent } from './modal/modal.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { DragDropModule } from '@angular/cdk/drag-drop';
@melkorCBA
melkorCBA / landing.component.ts
Created October 26, 2020 13:50
landing component class
import { Router } from '@angular/router';
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-landing',
templateUrl: './landing.component.html',
styleUrls: ['./landing.component.scss']
})
export class LandingComponent implements OnInit {
@melkorCBA
melkorCBA / landing.component.html
Created October 26, 2020 13:48
landing template
<div class="landing">
<div class="landing-heading">
Like bootstrap modal but it's a fully customizable angular component <br> Resizable and Draggable and Much More
</div>
<div class="landing-subheading">
Make Your Own Modal, A Fully Customizable Angular Component
</div>
<div class="landing-desc">