Skip to content

Instantly share code, notes, and snippets.

View MatthiasPortzel's full-sized avatar

Matthias MatthiasPortzel

View GitHub Profile
import express from "express";
import Turn from "node-turn";
//App serves user controlled HTML inside of a content security policy
//The app can run JS but shouldn't be able to "phone-home" to a remote server
//This is untrusted
const CODE = `<!DOCTYPE html>
<html>
<body>

Making git diff and less work together nicely on Mac

For reference, some Less options we're going to be using:

  • -S, less doesn't wrap lines;
  • -F, less auto-exits if output less than a page
  • -R, less honors color control codes
  • -X, disables termcap. This is set by git by default, but it breaks scrolling for some reason
  1. Make sure you're using the most recent version of both software. (The versions that are compiled by Apple and included in macOS are non-standard.)
% Prolog doesn't have functions, per se. It has statements that are true.
% For example, addition(2, 2, 4) can be read as "two plus two is 4".
% And it doesn't return anything.
% It can sometimes be helpful to think of the third value as a return value,
% however, the power of Prolog is that the statements can be read both "forward" and "backward"
% Prolog is like a deduction machine.
% Given a list of facts, it will deduce the values of any variables (things that start with capital letters)