Skip to content

Instantly share code, notes, and snippets.

View sandeepsuvit's full-sized avatar
🎯
Focusing

Sandeep K Nair sandeepsuvit

🎯
Focusing
  • Bangalore
View GitHub Profile
@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 / 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 / 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 / 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.
*