Skip to content

Instantly share code, notes, and snippets.

@reynotekoppele
reynotekoppele / utilities.js
Last active August 2, 2022 13:59
Javascript utilities
/* global ajax_object */
/**
* Make AJAX request to WordPress.
*
* @param {RequestInit} [options] Fetch options.
* @param {AbortController} [controller] Controller for current request.
*
* @throws Will throw an error if the status code is not 2xx.
* @throws Will throw data if the WordPress success status is false.
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
# Run following commands to install modules
# - Install-Module -Name Terminal-Icons -Repository PSGallery
# - Install-Module -Name PSReadLine -RequiredVersion 2.2.0-beta1 -AllowPrerelease (prerelease needed for listview, 01-11-2021)
# Installation for oh-my-posh
# - winget install JanDeDobbeleer.OhMyPosh
# Load modules
if ($host.Name -eq 'ConsoleHost') {
Import-Module PSReadLine