Skip to content

Instantly share code, notes, and snippets.

View jibeetz's full-sized avatar

Jean-Baptiste jibeetz

  • Zug, Switzerland
View GitHub Profile
@joepie91
joepie91 / express-server-side-rendering.md
Last active February 20, 2024 20:52
Rendering pages server-side with Express (and Pug)

Terminology

  • View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
  • View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
  • HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
  • String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
@sabl0r
sabl0r / confirm.js
Created December 11, 2015 08:48 — forked from stefket/confirm.js
JavaScript confirm with magnific popup
var confirmDialog = function(message, headline, cb) {
var dialog = '<div class="dialog confirm mfp-with-anim">';
if (headline) {
dialog += '<h2>' + headline + '</h2>';
}
dialog += '<div class="content"><p>' + message + '</p></div>';
dialog += '<div class="actions">';
dialog += '<button type="button" class="btn btn-default btn-cancel">Abbrechen</button> ';
dialog += '<button type="button" class="btn btn-primary btn-submit">OK</button>';
dialog += '</div>';
@PurpleBooth
PurpleBooth / README-Template.md
Last active June 10, 2024 06:12
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites