Skip to content

Instantly share code, notes, and snippets.

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

Chinedu Ekene Okpala AllStackDev1

🏠
Working from home
View GitHub Profile
@AllStackDev1
AllStackDev1 / git-commit-template.md
Created June 16, 2024 02:34 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

The always enthusiastic and knowledgeable mr. @jasaltvik shared with our team an article on writing (good) Git commit messages: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@AllStackDev1
AllStackDev1 / getHistory.js
Created December 3, 2018 18:22
Trying to get user history of my app
// I use passport as auth so req.user is set by it.
// Is this code feasible enough when the user has many farms with different crops, i.e when the user data grows
// As of now the code taken up to 1412 ms to complete
const { Farm } = require('../models/farm');
getHistory = function(req, res, next) {
Farm.find().distinct('cropId', { userId: req.user._id }, (err, cropIds) => {
if (err) return res.send({ success: false, err });
let i = 0;
let data = [];