Skip to content

Instantly share code, notes, and snippets.

View sandeepsuvit's full-sized avatar
🎯
Focusing

Sandeep K Nair sandeepsuvit

🎯
Focusing
View GitHub Profile
@sandeepsuvit
sandeepsuvit / css_inline_transformer.js
Created July 31, 2020 09:42 — forked from nirvanatikku/css_inline_transformer.js
JavaScript CSS Inline Style Transformer (convert CSS + HTML into HTML with inline styles)
/**
* CSS Inline Transform v0.1
* http://tikku.com/css-inline-transformer-simplified
*
* Copyright 2010-2012, Nirvana Tikku
* Dual licensed under the MIT or GPL Version 2 licenses.
* https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
*
* This tool leverages the jQuery library.
*
@sandeepsuvit
sandeepsuvit / ParseRSAKeys.java
Created July 8, 2020 10:01 — forked from destan/ParseRSAKeys.java
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@sandeepsuvit
sandeepsuvit / app.module.ts
Created May 13, 2020 14:28 — forked from adriano-di-giovanni/app.module.ts
Multi-tenant Mongoose module for Nest
import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TenancyModule } from '@app/tenancy';
import { OrderModule } from './order';
import { PaymentModule } from './payment';
import { Request } from 'express';
@Module({
imports: [TenancyModule.forRoot({
@sandeepsuvit
sandeepsuvit / interfaces.mongo-options.interface.ts
Created January 13, 2020 08:23 — forked from AliYusuf95/interfaces.mongo-options.interface.ts
MongoDB driver module for NestJS with dynamic mongo connection creation per request and handling open connections
import { ModuleMetadata, Type } from '@nestjs/common/interfaces'
/**
* Options that ultimately need to be provided to create a MongoDB connection
*/
export interface MongoModuleOptions {
connectionName?: string
uri: string
dbName: string
clientOptions?: any
@sandeepsuvit
sandeepsuvit / .env
Last active April 27, 2024 08:22
nestjs file upload using multer
##
# File properties
##
UPLOAD_LOCATION=/Users/dummyusername/Documents/temp/nvaluate
# Max 5Mb allowed
MAX_FILE_SIZE=5
MAX_FILE_COUNTS=20
@sandeepsuvit
sandeepsuvit / angular-clipboard-event.html
Last active January 31, 2020 14:00
Angular2 clipboard paste event
<textarea placeholder="Type a message" (paste)="onPaste($event)"></textarea>
<!-- Place to render the image -->
<img #imgRenderer />
@sandeepsuvit
sandeepsuvit / clipboard_image_post_js.html
Created February 21, 2019 17:41 — forked from kidatti/clipboard_image_post_js.html
Upload clipboard image to server (HTML5 / JavaScript / AJAX)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
</head>
<body>
<script>
@sandeepsuvit
sandeepsuvit / img-fit-in-div.html
Last active September 11, 2018 17:07
Fit image inside a div using css flex properties
<div class="img-container">
<img class="img-to-fit" src="https://images.pexels.com/photos/8633/nature-tree-green-pine.jpg" />
</div>
@sandeepsuvit
sandeepsuvit / time-of-day-util.ts
Last active September 6, 2018 17:24
Utility to get time of day example Morning, Afternoon or Evening
// Set of utility functions
export const TimeUtils = {
/**
* Get the time of day
* =========================================================================
* This utility will get the time of day like Morning, Afternoon, Evening.
* <br/>
*
* example: getTimeOfDay() -> morning
* example: getTimeOfDay(new Date()) -> afternoon
@sandeepsuvit
sandeepsuvit / flex-utils.scss
Created September 6, 2018 06:45
Flexbox utilities for bootstrap 3
/* -------------------------------------------------------------------------- */
// For bootstrap 3
.d-flex {
display: flex;
/* alignment */
&.flex-row {
flex-direction: row;
}
&.flex-row-reverse {