Skip to content

Instantly share code, notes, and snippets.

View dangayle's full-sized avatar

Dan Gayle dangayle

View GitHub Profile
@laurenfazah
laurenfazah / authentication_with_express_postgres.md
Last active July 13, 2024 16:51
Authentication with an Express API and Postgres

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@mrbar42
mrbar42 / README.md
Last active March 14, 2025 21:14
Secured HLS setup with Nginx as media server

Secured HLS setup with Nginx as media server

This example is part of this article.

This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:

  • Domain filtering
  • Referrer filtering
  • Embed buster
@sroccaserra
sroccaserra / convert_raw_to_aiff.py
Last active August 29, 2024 12:27
Convert from raw to aiff format
import argparse
"""
Works only for raw 8 bit signed mono data.
This script was writen as an easy way to convert original Amiga ST-XX raw
samples to a more documented format that keeps the original data untouched.
See also:

Welcome to the wacky world of almost 30 years of web

All of the following values for the <script type=" ••• "> will cause inline or external JavaScript to execute:

Value Note
"" The default value of script.type (eg: no type attribute present)
"text/javascript" The official JavaScript MIME type
"application/javascript" Legacy MIME type from when semantics mattered
"text/x-javascript" Legacy MIME type from before JavaScript was accepted as a valid MIME type
@kurtextrem
kurtextrem / README.md
Last active March 17, 2025 09:54
Tame GTM & 3p scripts to improve INP

Tame GTM & 3p scripts to improve INP

Add this to before you load any 3p (especially GTM) in the document.

What it does is when it executes:

  • for click, auxclick, mousedown, keyup and submit, installs a document level addEventListener override that intercepts added listeners if it's likely they from from a 3p (-> based on the 3rd argument passed to the fn)

On the document load event (so that it executes after GTM etc.):

  • for the same events, installs a document.body level override
  • overrides dataLayer.push and gtag() to yield first