HTML Sitemap для WordPress

<!-- Pages -->
<h2>Страницы</h2>
			<ul>
				<?php
				wp_list_pages(array(
					'exclude' => '[199, 3, 1099]',
					'title_li' => '',
				)); ?>
			</ul>
		<?php endwhile; ?>
		<!-- End Pages -->

		<!-- Categories and Posts   -->
		<?php

		$category = get_taxonomy('category');

		// echo '<h2><a href="/' . $category->rewrite['slug'] . '/">' . $category->labels->name . '</a></h2>';

		$cats = get_categories('exclude=');
		foreach ($cats as $cat) {
			$cat_link = get_catego

Island Perimeter

/**
 * @param {number[][]} grid
 * @return {number}
 */
var islandPerimeter = function(grid) {
    // Initialize perimeter to 0
    var perimeter = 0;

    // Loop through each cell in the grid
    for (var i = 0; i < grid.length; i++) {
        for (var j = 0; j < grid[i].length; j++) {

            // If the cell is land (1)
            if (grid[i][j] === 1) {

                // Add 4 to the perimeter (assuming it's a standalone cell)
                perimeter += 4;

                // If the

Not Shipped Sales Orders

SELECT
  RTRIM(dbo.dttord.to_billpo) AS [Bill To PO],
  dbo.dttord.to_ordnum AS [Sales Order Number],
  dbo.dttord.to_dueship AS [MRP Date],
  RTRIM(dbo.dmbill.bi_name) AS [Bill To],
  RTRIM(dbo.dmship.sh_name) AS [Ship To],
  dbo.dttord.to_totdue AS Amount,
  dbo.dmbill.bi_id,
  dbo.dmship.sh_id,
  RTRIM(dbo.dmship.sh_state) AS [Ship To State]
FROM
  dbo.dttord
  INNER JOIN dbo.dmbill ON dbo.dmbill.bi_id = dbo.dttord.to_biid
  INNER JOIN dbo.dmship ON dbo.dmship.sh_id = dbo.dttord.

Slurm test script

#!/bin/bash

#SBATCH --job-name=boops 
#SBATCH --partition=walkerpass
#SBATCH --ntasks=1                       
#SBATCH --cpus-per-task=30               
#SBATCH --mem=170G                       
#SBATCH --time=00:05:00                  
#SBATCH --output=%j_job.out         
#SBATCH --error=%j_job.err          

# Optional: Load modules if needed
# module load some_module

# A simple test command 
hostname
echo "This job ran on $(hostname) at $(date)" 

管理画面 h1テキストをロゴ画像に差し替え

// =====================================================
// h1テキストをロゴ画像に差し替え
// =====================================================
window.addEventListener("DOMContentLoaded", () => {
	const siteName = document.querySelector("body.index-php #wp-admin-bar-site-name .ab-item");
	if (siteName) {
		const h1 = document.querySelector("h1");
		const domainUrl = window.location.origin;
		const logoImg = document.createElement("img");
		logoImg.src = `${domainUrl}/wp-content/themes/theme/asset

管理画面 投稿タイトル「ブロックエディター」「クラシックエディター」の表記削除

// =====================================================
// 管理画面 投稿タイトル「ブロックエディター」「クラシックエディター」の表記削除
// =====================================================
const myPostTitles = document.querySelectorAll(".wp-list-table  .column-title.page-title > strong");
myPostTitles.forEach((element) => {
	// <strong> タグ内の <a> タグを取得
	const aTag = element.querySelector("a.row-title");
	// <a> タグが存在する場合
	if (aTag) {
		console.log(aTag.outerHTML);
		element.innerHTML = aTag.outerHTML;
	}
});

Automatically open (and keep open) the GoHighLevel chat widget

Automatically open (and keep open) the GoHighLevel chat widget
<script>
  // For a HighLevel webpage (funnel or website) that is meant to be a dedicated chatting area.
  // Copy all of this and paste into your custom code, such as in the Footer Tracking area.
  // This snippet: https://gist.github.com/cliffordp/1428be81a842d5b93c793d2d5b967007
  // Source demo: https://10xmarketing.ai/10x-chatbot-widget
  function openChatWidget() {
    // Check if Chat Widget exists.
    if (window.leadConnector && window.leadConnector.chatWidget) {
        // If it exists

調べもの

<div class="content_right">
				<?php
				$post_type_info = array(
					'news' => array(
						'title' => 'やまぎしからのお知らせ',
						'label' => 'お知らせ',
						'slug' => 'news',
						'taxonomy' => 'news_cat'
					),
					'recipe' => array(
						'title' => 'はちみつレシピ',
						'label' => 'レシピ',
						'slug' => 'recipe',
						'taxonomy' => 'recipe_cat'
					),
					'column' => array(
						'title' => '養蜂場のとっておきコラム',
						'label' => 'コラム',
						'slug' => 'column',
						'taxonomy' => 'c

elementor anchor margin top

https://github.com/elementor/elementor/issues/13177
/* top spacing above anchor links*/
body:not(.elementor-editor-active) .elementor-menu-anchor:before {
  content: "";
  display: block;
  height: 70px;
  margin: -70px 0 0;
  visibility: hidden;
  pointer-events: none;
}

Vertical unordered list

https://jsfiddle.net/cfzsgkyn/

<div class="list-wrapper">

    <div class="red-line"></div>
    
    <div class="list-item-wrapper">
        <div class="list-bullet">1</div>
        <div class="list-item">
            <div class="list-title">This is the top item</div>
            <div class="list-text">The parallels with the alcoholic republic of two hundred years ago are hard to miss. Before the changes in lifestyle, before the clever marketing, comes the mountain of cheap corn. </div>
       

CommandAs

function Invoke-CommandAs {

    #Requires -Version 3.0

    <#
    
    .SYNOPSIS
    
        Invoke Command as System/User on Local/Remote computer using ScheduleTask.
    
    .DESCRIPTION
    
        Invoke Command as System/User on Local/Remote computer using ScheduleTask.
        ScheduledJob will be executed with current user credentials if no -As <credential> or -AsSystem is provided.
    
        Using ScheduledJob as they are ran in the background and the output can be

Smallest From Leaf

/**
 * Definition for a binary tree node.
 * function TreeNode(val, left, right) {
 *     this.val = (val===undefined ? 0 : val)
 *     this.left = (left===undefined ? null : left)
 *     this.right = (right===undefined ? null : right)
 * }
 */
/**
 * @param {TreeNode} root
 * @return {string}
 */
var smallestFromLeaf = function(root) {
    // We need to initialize the smallest string as a large value
    let smallest = "~";

    const dfs = (node, str) => {
        // If the node is null, we re

Large Table Paginator

class LargeTablePaginator(Paginator):
    """
    # https://gist.github.com/noviluni/d86adfa24843c7b8ed10c183a9df2afe
    Overrides the count method of QuerySet objects to avoid timeouts.
    - Get an estimate instead of actual count when not filtered (this estimate can be stale and hence not fit for
    situations where the count of objects actually matter).
    """

    @cached_property
    def count(self):
        """
        Returns an estimated number of objects, across all pages

Nick's Snippet inside payment iterator

<mvt:foreach iterator="payment" array="order:payments">
		<p class="column whole align-right">
			<mvt:if expr="l.settings:payment:type EQ 6">
				<em>Refund: &mvt:payment:desc;: &mvt:payment:formatted_amount;</em>
			<mvt:else>
				<em>Payment: &mvt:payment:desc;: &mvt:payment:formatted_amount_negative;</em><br>
	 
			</mvt:if>
<mvt:comment> From Nick at Miva to print out Payment Method Payment Description </mvt:comment>																			

                                                      

Nick's Snippet after payment iterator

<mvt:comment> From Nick at Miva to print out Payment Method Payment Description </mvt:comment>                                 
<mvt:comment> Set delimiter variables </mvt:comment>
<mvt:assign name="g.colon" value="':'" />
<mvt:assign name="g.comma" value="','" />
<mvt:assign name="g.equal" value="'='" />

<mvt:comment> First seperate string by the colon and add to an array </mvt:comment>
<mvt:do file="g.Module_Library_Utilities" name="l.null" value="SplitString( l.settings:order:pay_data, g.col

defineProps - Vue (and reactive behavior)

<script setup>
import  Child  from './Child.vue'
import { ref } from 'vue'

const test = ref('one')

setTimeout(() => {
  test.value = 'two'
}, 3000)

</script>

<template>
  <h1>Parent</h1>
  <Child :test="test"/>
</template>