Skip to content

Instantly share code, notes, and snippets.

@Antarian
Antarian / port_release.md
Last active January 7, 2024 17:52
Ubuntu port freeing

Find on port (second column is process_id):

sudo lsof -i -P -n | grep {port number}

Kill on port:

sudo kill {process_id}
@Antarian
Antarian / express-server-side-rendering.md
Created February 20, 2018 17:55 — forked from joepie91/express-server-side-rendering.md
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
@Antarian
Antarian / git.md
Last active October 22, 2020 13:49
Git commands

Cleaning

Show informations about remote branches:

git remote show origin

Stop tracking deleted remote branches:

git remote prune origin --dry-run