Skip to content

Instantly share code, notes, and snippets.

View jose-matias's full-sized avatar
🎯
Focusing

José Matias jose-matias

🎯
Focusing
View GitHub Profile
@FranLpz
FranLpz / robomongo-install.sh
Created February 8, 2018 19:06
Script for install robomongo
#!/bin/bash
# Enter /opt folder (common folder for user installed programs)
# This script assumes you have proper permissions on /opt
cd /opt
# Download robomongo
wget https://download.robomongo.org/1.1.1/linux/robo3t-1.1.1-linux-x86_64-c93c6b0.tar.gz -O robomongo.tar.gz
# Delete Old robomongo if exists.
if [ -d robomongo/ ]; then
@joshnuss
joshnuss / app.js
Last active March 4, 2024 00:01
Express.js role-based permissions middleware
// the main app file
import express from "express";
import loadDb from "./loadDb"; // dummy middleware to load db (sets request.db)
import authenticate from "./authentication"; // middleware for doing authentication
import permit from "./authorization"; // middleware for checking if user's role is permitted to make request
const app = express(),
api = express.Router();
// first middleware will setup db connection