Skip to content

Instantly share code, notes, and snippets.

View subratastack's full-sized avatar
🎯
Focusing

Subrata Banerjee subratastack

🎯
Focusing
View GitHub Profile
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Scanner;
public class BankApp {
@subratastack
subratastack / _mixins.styl
Created October 10, 2019 09:56 — forked from dmitrykuznetsovdev/_mixins.styl
mixins.stylus
// Display:
// appearance
// box-align
// box-flex
// box-sizing
// box-orient
// box-pack
// display-box
// overflow-sroll
// user-select
@subratastack
subratastack / whatsapp-image-compression
Created October 3, 2019 19:49 — forked from akshay1188/whatsapp-image-compression
Whatsapp like image compression
- (UIImage *)compressImage:(UIImage *)image{
float actualHeight = image.size.height;
float actualWidth = image.size.width;
float maxHeight = 600.0;
float maxWidth = 800.0;
float imgRatio = actualWidth/actualHeight;
float maxRatio = maxWidth/maxHeight;
float compressionQuality = 0.5;//50 percent compression
if (actualHeight > maxHeight || actualWidth > maxWidth) {
@subratastack
subratastack / app.component.ts
Created March 21, 2019 23:09
Angular 7 Pipes
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
public searchTerm: string = '';
@subratastack
subratastack / app.component.html
Created March 21, 2019 23:09
Angular 7 Pipes
<h1>
Angular 7 Pipes
</h1>
<div>
<div>
<input type="search" placeholder="Search" [(ngModel)]="searchTerm">
</div>
<div>
<table class="user-table">
<thead class="user-table-header">
@subratastack
subratastack / search.pipe.ts
Created March 21, 2019 23:08
Angular 7 Pipes
import {Pipe, PipeTransform} from '@angular/core';
@Pipe({
name: 'userSearch'
})
export class SearchPipe {
transform(data: any[], args: string): any[] {
if (args === '') {
return data;
} else {
@subratastack
subratastack / app.module.ts
Created March 21, 2019 23:08
Angualr 7 Pipes
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { HelloComponent } from './hello.component';
import { SearchPipe } from './search.pipe'
@NgModule({
imports: [ BrowserModule, FormsModule ],
declarations: [ AppComponent, HelloComponent, SearchPipe ],