video fv switching

<div class="mv-inner" id="videoContainer">
                <video id="videoPlayer1" class="active" muted autoplay data-video="したごしらえ">
                    <source src="" type="video/mp4"> <!-- Desktop source -->
                    <source src="" type="video/mp4"> <!-- Mobile source -->
                </video>
                <video id="videoPlayer2" muted autoplay data-video="お料理">
                    <source src="" type="video/mp4"> <!-- Desktop source -->
                    <source 

Parse XtreamCode Url

public static void ParseXtreamCodeUrl()
{
    var regexPattern =
        @"^(?:(?<protocol>(?:https?))://(?<host>(?:(?:.*)))):(?<port>(?:\d{2,5}))?/get\.php\?username=(?<username>.*)&password=(?<password>\w*)|(?:(?<protocol>(?:https?))://(?<host>(?:(?:.*))))?/get\.php\?username=(?<username>.*)&password=(?<password>\w*)";

    var match = Regex.Match(_url, regexPattern, RegexOptions.ExplicitCapture | RegexOptions.IgnoreCase);
    
    if (match.Success)
    {
        var protocol = match

Sum Numbers

/**
 * 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 {number}
 */
var sumNumbers = function(root) {
    // This function will perform a depth-first search on the tree
    function dfs(node, sum) {
        // If the node is null, we return 0
        if (node === null)

Translation initializer


const script = document.createElement("script");
script.setAttribute("id", "classy-translate");
script.src = "https://classy-prod-assets.s3.amazonaws.com/_marketing/_customizations/translation/main.js";
script.onload = classyTranslate;
document.head.appendChild(script);

function classyTranslate() {
  const spanish = new window["Translation"] (
    "spanish",
    "aws-url.com"
  );
  const deutsch = new window["Translation"] ("
  	"deutsch", 
  	"aws-url.com"
  ");
  spanish.setCampaigns([11111

Component - Content Gallery

{
    "key": "group_65c3d54c53ca5",
    "title": "Component - Content Gallery",
    "fields": [
        {
            "key": "field_65c3d54c67e1e",
            "label": "Content Gallery",
            "name": "content_gallery",
            "aria-label": "",
            "type": "group",
            "instructions": "",
            "required": 0,
            "conditional_logic": 0,
            "wrapper": {
                "width": "",
                "class": "",
                "id": ""
           

Styling Exposed View Forms in Drupal 8 - Twig Template

Styling Exposed View Forms in Drupal 8 - Twig Template
{#
/**
 * @file
 * Theme override for a select element.
 *
 * Available variables:
 * - attributes: HTML attributes for the select tag.
 * - options: The option element children.
 *
 * @see template_preprocess_select()
 */
#}
{% spaceless %}
  <div class="select-style">
    <select{{ attributes }}>
      {% for option in options %}
        {% if option.type == 'optgroup' %}
          <optgroup label="{{ option.label }}">
            {% for sub_option in option.options %}
              <option va

Add Schema.org BreadcrumbList inline in Drupal 8+ in your theme's templates.

Add Schema.org BreadcrumbList inline in Drupal 8+ in your theme's templates.
{#
/**
 * @file
 * Theme override for a breadcrumb trail.
 *
 * Available variables:
 * - breadcrumb: Breadcrumb trail items.
 */
#}
{% if breadcrumb %}
  <ol itemscope itemtype="http://schema.org/BreadcrumbList" class="breadcrumbs" aria-label="breadcrumb">
  {% for item in breadcrumb %}
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
      {% if item.url %}
        <a itemprop="item" href="{{ item.url }}">
          <span itemprop="name">{{ item.text }}</span

wordpress rest api route check request from origin

<?php

/**
 * !@note Проверка что запрос к api был с того же источника что и сам роут
 */
function validate_request_origin(/* WP_REST_Request $request */) {
	$request_origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : '';
	$site_url = parse_url(get_site_url());

	if (parse_url($request_origin, PHP_URL_HOST) === $site_url['host']) {
			return true;
	}

	return new WP_Error('not_found', 'Not found', array('status' => 404));
}

wordpress rest api route for write to csv file

<?php

function write_csv_register_rest_route()
{
	register_rest_route('write_csv/v1', '/process', array(
		'methods' => 'POST',
		'callback' => 'write_csv_process_callback',
		'permission_callback' => 'validate_request_origin'
	));
}

function write_csv_process_callback($request)
{
	$parameters = $request->get_json_params();

	$data = "";
	$first = true;
	foreach ($parameters['data'] as $value) {
		if ($first) $data .= "{$value}"; 
		else $data .= ",{$value}"; 
		$first = false;
	}
	$data.="\n"

Nuxt3で汎用タブコンポーネント(オブジェクトでv-for)

<template>
  <section class="tabcontainer">
    <MyTab :amount="4">
      <template #tab1><span>タブ1</span></template>
      <template #panel1><div>パネル1</div></template>
      <template #tab2><span>タブ2</span></template>
      <template #panel2><div>パネル2</div></template>
      <template #tab3><span>タブ3</span></template>
      <template #panel3><div>パネル3</div></template>
      <template #tab4><span>タブ4</span></template>
      <template #panel4><div>パネル4</div></template>
    </MyTab>
  </section>
</

style、scriptの読み込み

// カスタムCSS/JS読み込み
function my_scripts() {
  if (is_user_logged_in()) {
    wp_enqueue_style('admin_front', get_stylesheet_directory_uri() . '/admin/assets/css/admin_front.css', false, filemtime( get_theme_file_path( '/admin/assets/css/admin_front.css' )));
  }

  wp_enqueue_style('style_custom', get_stylesheet_directory_uri() . '/assets/css/style_custom.css', false, filemtime( get_theme_file_path( '/assets/css/style_custom.css' )));

  if (is_page('contact') || is_page('complete')) {
  

Configuration options object

// JS
function setPreferences({ theme = 'dark', layout = 'grid' } = {}) {
  console.log(`Preferences set: Theme - ${theme}, Layout - ${layout}`);
}

export function useRefHistory(ref, options) {
  const {
    deep = false,
    capacity = Infinity,
  } = options;

  // ...
};

// https://michaelnthiessen.com/tips/options-object
export function useRefHistory(ref, options) {
  const {
    deep = false,
    capacity = Infinity,
    ...otherOptions,
  } = options;

  // Pass along some options we're 

pointer-events:noneだけではキーボードでアクセスできてしまう

<div inert tabindex="0"></div>

GPUで処理できるCSSの変化にGPU使用を明記する

.hoge {
  transform: translate3d(); // これでもいいし
  will-change: transform; // これでもいい
}

Form Repeater | Add Entry Repeat Form

Repeat Form

//HTML
<form id="formPrimaryDetail" method="post" enctype="multipart/form-data">

@*Accadamic Qualifications*@
<div class="row mb-4">
    <div class="col-md-9">
        <div class="mb-3">

            @*qualification-entry-template d-none*@
            <div class="qualification-entry-template pb-2 d-none">
                <div class="d-flex justify-content-start">
                    <div class="pe-5">
                        <select asp-items="ViewBag.QualificationTyp

Sum Of Left Leaves

/**
 * 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 {number}
 */
var sumOfLeftLeaves = function(root) {
    // Initialize the sum to 0
    var sum = 0;

    // Define a helper function to traverse the tree
    var traverse = function(node, isLeft) {
        // If th