Skip to content

Instantly share code, notes, and snippets.

View abbasogaji's full-sized avatar

Abbas Ogaji abbasogaji

View GitHub Profile
@abbasogaji
abbasogaji / Dockerfile
Created December 15, 2019 23:01
Dockerfile for NestJs Production deployment
FROM node:10 AS builder
WORKDIR /app
COPY ./package.json ./
RUN npm install
COPY . .
RUN npm run build
FROM node:10
WORKDIR /app
@abbasogaji
abbasogaji / email-template.html
Created November 24, 2019 16:11
html template
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Simple Transactional Email</title>
<style>
/* -------------------------------------
GLOBAL RESETS
------------------------------------- */
@abbasogaji
abbasogaji / user.controller.js
Created November 24, 2019 15:47
user controller
const User = require("../model/User")
const emailtemplates = require('../utils/email-template')
const sgMail = require('@sendgrid/mail')
//
// ─── CREATE METHODS ─────────────────────────────────────────────────────────────
//
exports.createUser = (req, res, next) => {
@abbasogaji
abbasogaji / user.controller.test.js
Last active November 24, 2019 16:05
Test Script for user registration
const httpMocks = require('node-mocks-http')
const expect = require('expect')
const mongoose = require('mongoose')
const { parse } = require('node-html-parser');
const userController = require('./user.controller')
const dotenv = require('dotenv').config();
const { MailSlurp } = require('mailslurp-client')
const User = require('../model/User')
@abbasogaji
abbasogaji / User.js
Created November 24, 2019 14:28
user moogose schema
//
// ──────────────────────────────────────────────────────────────────────────── I ──────────
// :::::: U S E R M O N G O D B M O D E L : : : : : : : :
// ──────────────────────────────────────────────────────────────────────────────────────
/********************************************************************************************
*
* Information for stored in the document include;
* Name,
* Email,
* Password
@abbasogaji
abbasogaji / package.json
Last active November 24, 2019 13:20
Dependencies on Package JSON for my mailSlurp-on-nodejsapp demo
"devDependencies": {
"dotenv": "^8.2.0",
"expect": "^24.9.0",
"jest": "^24.8.0",
"mailslurp-client": "^6.5.0",
"node-html-parser": "^1.1.16",
"node-mocks-http": "^1.7.6"
},
"dependencies": {
"@sendgrid/mail": "^6.4.0",
import { Component, OnInit } from '@angular/core';
import { UserService } from './user.services';
import { trigger } from '@angular/animations';
import { fadeIn } from '../animation/fadeIn';
@Component({
selector: 'app-user',
templateUrl: './user.component.html',
styleUrls: ['./user.component.css'],
providers: [UserService],
@abbasogaji
abbasogaji / simpleFadeIn.animation.ts
Last active February 17, 2019 17:05
Angular 7, angular animations
import { style, animate, transition } from '@angular/animations';
export function fadeIn(){
return [
transition(':enter', [
style({opacity: 0}),
animate('400ms ease-in', style({opacity: 1}))
])
];
}