Skip to content

Instantly share code, notes, and snippets.

@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
@dspeele
dspeele / gist:79a7a4c78f4c040084fb
Last active October 5, 2017 17:54
Getting started- Learn Scala

Installing the JDK

Linux

  • Ubuntu, Debian: To install the JDK using apt-get, execute the following command in a terminal sudo apt-get install openjdk-7-jdk

  • Fedora, Oracle, Red Had: To install the JDK using yum, execute the following command in a terminal su -c "yum install java-1.7.0-openjdk-devel"

  • Manual Installation: To install the JDK manually on a Linux system, follow these steps: