This article walks you through how to get the ID of any YouTube video.
You may be watching the video or just happened to visit a link to a video. The video ID will be located in the URL of the video page, right after the v= URL parameter.
| <?php | |
| /** | |
| * This is free and unencumbered software released into the public domain. | |
| * | |
| * Anyone is free to copy, modify, publish, use, compile, sell, or | |
| * distribute this software, either in source code form or as a compiled | |
| * binary, for any purpose, commercial or non-commercial, and by any | |
| * means. | |
| * |
| <?php | |
| /** | |
| * Plugin Name: Disable Yoast SEO Automatic Open Graph Images | |
| * Plugin URI: https://gist.github.com/jakebellacera/c2aab8f786a0617b27dd4914c70463d4 | |
| * Description: Shows the default open graph image in case a feature image isn't set, rather than showing a random image on the page. | |
| * Version: 0.0.0 | |
| * Author: Jake Bellacera | |
| * Author URI: https://www.jakebellacera.com/ | |
| */ |
This article walks you through how to get the ID of any YouTube video.
You may be watching the video or just happened to visit a link to a video. The video ID will be located in the URL of the video page, right after the v= URL parameter.
| /* | |
| * CSS Time to Milliseconds | |
| * by Jake Bellacera (http://jakebellacera.com) | |
| * ============================================ | |
| * | |
| * Converts CSS time into milliseconds. Useful for timing functions around CSS animations. | |
| * It supports both seconds (s) and milliseconds (ms). | |
| * | |
| * Arguments: | |
| * time_string - string representation of a CSS time unit (e.g. "1500ms" or "1.5s") |
| // The script below will ensure that gclid parameters are associated with | |
| // contacts in HubSpot. | |
| // | |
| // A few things are required before this script will work: | |
| // | |
| // * You will need to have the HubSpot tracking code installed on the page. A | |
| // few modifications will be required if you don't have the tracking code | |
| // installed. Additionally, you will lose out on the built-in cross-domain | |
| // features that the hubspot tracking code uses to store cookies. | |
| // * You will need to have this script installed on every page. |
| // How to use: | |
| // 1. In VS Code, perform a search. | |
| // 2. Click "Open in editor" to open the search results in a `.code-search` file | |
| // 3. Save the file | |
| // 4. In terminal, run `node export-vscode-search-to-csv.js path/to/results.code-search path/to/exported.csv` | |
| const fs = require("fs"); | |
| const path = require("path"); | |
| const readline = require("readline"); |
Basic HTTP Authentication is when a user is required to log in to access a directory. This isn't meant to be secure by any means, but it's useful for locking out a majority of users from accessing a folder (e.g. staging a website).
To start, you must add this into your .htaccess:
AuthUserFile "/var/www/full/path/to/your/folder/.htpasswd"
AuthName "Message to go on user's login screen"
AuthType Basic
Allow from all
Require valid-user
Options +Indexes
Source mapping is a technique that "maps" your browser inspector's line numbers to the source file. This is useful when working with assets that are compiled from LESS, SASS, Coffeescript and so on. Source maps can also be used with minified assets that would normally have their line numbers removed. If you're curious, here's some more information regarding source maps.
| import fs from "node:fs/promises"; | |
| const camelize = (s) => s.replace(/-./g, (x) => x[1].toUpperCase()); | |
| const getPathsFromSvg = async (path) => { | |
| const svg = await fs.readFile(path, { encoding: "utf-8" }); | |
| const paths = svg.match(/d="(.*?)"/); | |
| if (!paths) { | |
| throw new Error(`No paths in file ${path}`); |