Skip to content

Instantly share code, notes, and snippets.

View fsojitra's full-sized avatar
🏠
Probably working from home

Foram Sojitra fsojitra

🏠
Probably working from home
View GitHub Profile
@nrollr
nrollr / Node_AWS_Linux.md
Last active May 7, 2023 14:18
Install Node.js on Amazon Linux (EC2)

Installing Node.js on Amazon Linux AMI

The following will guide you through the process of installing Node.js on an AWS EC2 instance running Amazon Linux AMI 2016.09 - Release Notes

For this process I'll be using a t2.micro EC2 instance running Amazon Linux AMI (ami-d41d58a7). Once the EC2 instance is up-and-running, connect to your server via ssh

@clauda
clauda / pagine.js
Last active November 21, 2017 11:51
Mongoose Pagination #NodeJS #Express #MongoDB
var mongoose = require('mongoose');
mongoose.Query.prototype.paginate = function(page, limit, callback) {
var query = this
, page = page || 1
, limit = limit || 10
, offset = (limit * page) - limit;
query = query.skip(offset).limit(limit);