Skip to content

Instantly share code, notes, and snippets.

View barman47's full-sized avatar
🏠
Working from home

Uzoanya Dominic barman47

🏠
Working from home
View GitHub Profile
@barman47
barman47 / sendEmail.js
Created August 13, 2022 19:22
Send email utility function for mailgun
const formData = require('form-data');
const Mailgun = require('mailgun.js');
const mailgun = new Mailgun(formData);
const DOMAIN = process.env.CYBERKACH_MAIL_DOMAIN;
const client = mailgun.client({
username: 'api',
domain: DOMAIN,
key: process.env.MAILGUN_API_KEY,
@barman47
barman47 / meta-tags.md
Created October 12, 2021 10:28 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@barman47
barman47 / questions.json
Created October 20, 2019 14:53
An array of objects containing questions for the quiz application
[
{
"question": "What temperature does water boil at?",
"optionA": "50 degrees Celcius",
"optionB": "25 degrees Celcius",
"optionC": "100 degrees Celcius",
"optionD": "150 degrees Celcius",
"answer": "100 degrees Celcius"
},
@barman47
barman47 / storing and downloading binary data in mongodb
Created November 21, 2018 12:40 — forked from mdsaleemj/storing and downloading binary data in mongodb
storing and downloading binary data in mongodb without grid-fs
//The below model is used to book a travel ride.
//The uploaded file is parsed in the formidable multipart body parser and stored in req.files.fileField.
//File is read from , in my code, req.files.file
var rideModel = function(){
var rideSchema = new Schema({
email : String,
corp_id : String,
name : String,
manager: String,
@barman47
barman47 / mogoose-gridfs
Created November 11, 2018 16:18
Boiler plate to help bootstrap mongoose-gridfs module usage
const express = require('express');
const fs = require('fs);
const multer = require('multer');
const router = express.Router();
let gridfs;
let Image;
const storage = multer.diskStorage({
@barman47
barman47 / sample.md
Created October 4, 2018 02:06
Uzoanya Dominic's Markdown Cheatsheet

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

This text is italic

@barman47
barman47 / server.js
Created October 2, 2018 01:02
This describes how to upload Files to MongoDB with gridfs and multer. This example may or may not contain complete working code. It's just a reference to the most important parts
const express = require('express');
const app = express();
const exphbs = require('express-handlebars');
const favicon = require('express-favicon');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const expressValidator = require('express-validator');
const session = require('express-session');
const cookieParser = require('cookie-parser');
const flash = require('connect-flash');