Skip to content

Instantly share code, notes, and snippets.

View redeemefy's full-sized avatar

redeemefy

  • Nashville, TN
View GitHub Profile

Keybase proof

I hereby claim:

  • I am redeemefy on github.
  • I am redeemefy (https://keybase.io/redeemefy) on keybase.
  • I have a public key ASDBKW7BeMJw5vUew5wNcWBBgytmt8bYnAsyxqwcLsvEzQo

To claim this, I am signing this object:

@redeemefy
redeemefy / main.ts
Last active January 27, 2022 00:20
Validate MongodbId automatically with ValidationPipe and a class dto
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.useGlobalPipes(new ValidationPipe({ // class-validator class-transformer for DTOs
transform: true, // converts payload to DTO classes in the controller
whitelist: true, // strip out props are not in DTOs
@redeemefy
redeemefy / launch.json
Created March 25, 2021 22:37
VSCode debugging file configuration
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
@redeemefy
redeemefy / nestjs-docker-compose.yml
Created March 18, 2021 23:21
A docker-compose.yml for developing with NestJS
version: '3.7'
services:
main:
container_name: main
build:
context: .
target: development
volumes:
- .:/usr/src/app
@redeemefy
redeemefy / esRestClient.js
Created September 23, 2020 00:42
ElasticSearch REST client that allows body in GET requests
const https = require("https")
const http = require("http")
const fetch = require("node-fetch")
const ElasticSearchRestClient = {
get: function(body, options = {}) {
return new Promise((resolve, reject) => {
const callback = function(response) {
let str = ""
@redeemefy
redeemefy / .tern-project
Created August 30, 2020 02:51
Settings for tern-project file
{
"libs": [
"browser"
],
"plugins": {
"node": {},
"modules": {},
"requirejs": {},
"es_modules": {},
"jasmine": {}
@redeemefy
redeemefy / messaging.serive.ts
Last active April 18, 2020 03:16
Communication Between Siblings Components Angular
// src/app/messaging.service.ts
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class MessagingService {
private subject = new Subject()