Livewire Page loader (CSS based loader, based on livewire events)


In blade file:
    <!-- PAGE LOADER -->
<div wire:loading.flex>
    <div id="loading-overlay">
        <div class="loader">
            <div class="loader__bar"></div>
            <div class="loader__bar"></div>
            <div class="loader__bar"></div>
            <div class="loader__bar"></div>
            <div class="loader__bar"></div>
            <div class="loader__ball"></div>
        </div>
    </div>
</div>


<form wire:submit="login"  method="POST" class="login_box">
    @csrf
    <

特定の文字だけfont-familyを変更する(省略の...をどのフォントでも常に最下部に表示したい場合など)

<div>
  sample sample sample sample sample sample sample sample sample 
</div>

Voeg role=button toe aan elke button (Accessibility)

Tom voor https://subsidiebeleidskaart.texel.nl/
function addButtonRoleToUkButtons() {
  const ukButtons = document.querySelectorAll('.uk-button');

  ukButtons.forEach((button) => {
    button.setAttribute('role', 'button');
  });

  return ukButtons.length;
}

if (document.readyState === 'loading') {
  document.addEventListener('DOMContentLoaded', addButtonRoleToUkButtons);
} else {
  addButtonRoleToUkButtons();
}

setTimeout(addButtonRoleToUkButtons, 500);

Menu header with mega menu and mobile

const megaMenu = () => {
	// Header Class = .site-header
	// menu iTEM  : .menu-item
	// When active menu-item : .is-active
	// submenu item ul:.sub-menu

	const menuItems = document.querySelectorAll(
		".site-header .menu > .menu-item"
	);
	if (!menuItems.length) return;

	const header = document.querySelector(".site-header");
	const isDesktop = () => window.innerWidth >= menuToggleBreakpoint;

	let activeMenuItem = null;
	let currentMegaMenu = null;

	const closeOpenMegaMenu = () => {
		if (ac

SVG Mask Image

// Applies an inline-SVG mask, colored via currentColor.
/// @param $svg        URL-encoded SVG string (no data: prefix)
/// @param $size       mask-size (default: contain)
/// @param $position   mask-position (default: center)
/// @param $repeat     mask-repeat (default: no-repeat)
/// @param $important  whether to append !important to bg-color & mask-image (default: false)
@mixin svg-mask(
  $svg,
  $size: contain,
  $position: center,
  $repeat: no-repeat,
  $important: false
) {

JS Shortcuts

40 JavaScript Shortcuts

//1–10: Syntax Shortcuts and Essentials

// 1. Ternary Operator
const isAdult = age >= 18 ? "Yes" : "No";

// 2. Default Parameters
function greet(name = "Guest") {
  return `Hello, ${name}`;
}

// 3. Arrow Functions
const add = (a, b) => a + b;

// 4. Destructuring Objects
const { name, age } = person;

// 5. Destructuring Arrays
const [first, second] = colors;

// 6. Template Literals
const message = `Hi, ${user.name}!`;

// 7. Spread Operator
const newArray = [...oldA

認知負荷を最小化する効果的な文章設計ガイド

※AIによる記述

# 認知負荷を最小化する効果的な文章設計ガイド

## 1. 認知負荷と文章理解の関係

### 認知負荷とは
認知負荷とは、特定の作業を遂行する際に脳の作業記憶(ワーキングメモリ)にかかる処理負担のことです。作業記憶には容量制限があり、過剰な負荷がかかると理解度や処理効率が低下します。

### 文章における認知負荷の影響
- 高い認知負荷 → 理解速度の低下、誤読の増加、記憶定着の阻害
- 最適化された認知負荷 → 効率的な情報処理、正確な理解、良好な記憶定着

## 2. 文書の目的別 認知負荷最適化戦略

文書の目的によって、最適な認知負荷削減戦略は異なります。大きく分けて「情報参照型」と「プロセス指示型」の二つの文書タイプに応じた最適化が必要です。

### 情報参照型文書の最適化

**目的**: 読者が特定の情報を素早く見つけ、理解できるようにする  
**例**: 通知文書、データシート、連絡事項、会議議事録

#### 最適化戦略:

1. **述語・接続語を最小化する**
   - 「本日の会議は

認知特性を活かした効果的な文章構築ガイド

※AIによる記述

# 認知特性を活かした効果的な文章構築ガイド

## 1. 人間の文章認知特性と誤読パターン

人間の文章認知には独自の特性があり、これらを理解することで効果的な文章作成が可能になります。

### 主な認知特性
- **トランスポジション効果**:単語の最初と最後の文字が正しければ、中間の文字が入れ替わっていても理解できる
- **チャンキング**:情報を意味のあるグループに分けて処理する傾向
- **文脈予測と補完**:文脈から予測を立て、不完全な情報を補完する能力

### 誤読が起きやすいパターン
- **視覚的類似性による混同**:「り」と「い」、「O」と「0」など
- **スキップ読みによる見落とし**:否定語や条件文の一部を見落とす
- **バッファリングエラー**:長い文の処理中に前半を忘れる
- **同音異義語の混同**:「異議」と「意義」など

## 2. 文書の目的による分類と最適化手法

文書は主に「情報参照型」と「プロセス指示型」に分類でき、それぞれに適した書き方があります。

### 情報参照

比較兩個 JSON 物件,並找出其中的不同之處

USE [JsonJogDemo]
GO

-- 刪除現有的 Compare_JsonObject 函數
DROP FUNCTION [dbo].[Compare_JsonObject]
GO

-- 設定 SQL Server 選項
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

-- 建立比較 JSON 物件的函數
CREATE FUNCTION [dbo].[Compare_JsonObject]
(@SourceJSON NVARCHAR (MAX), @TargetJSON NVARCHAR (MAX))
RETURNS @returntable TABLE
(
    SideIndicator CHAR(2), -- 比較結果指標: == 表示相等, <- 來源有但目標沒有, -> 目標有但來源沒有, <> 表示值不相等
    TheParent NVARCHAR(2000), -- JSON 物件的父層級
    ThePath NVARCHAR(2000), -- JSON 路徑 (SQL JSON 函數使用)

3342. Find Minimum Time to Reach Last Room II

There is a dungeon with n x m rooms arranged as a grid. You are given a 2D array moveTime of size n x m, where moveTime[i][j] represents the minimum time in seconds when you can start moving to that room. You start from the room (0, 0) at time t = 0 and can move to an adjacent room. Moving between adjacent rooms takes one second for one move and two seconds for the next, alternating between the two. Return the minimum time to reach the room (n - 1, m - 1). Two rooms are adjacent if they share a common wall, either horizontally or vertically.
/**
 * @param {number[][]} moveTime
 * @return {number}
 */
var minTimeToReach = function(moveTime) {
    const n = moveTime.length, m = moveTime[0].length;

    // Distance array initialized with Infinity, representing minimum time to reach each cell
    const d = Array.from({ length: n }, () => Array(m).fill(Infinity));

    // Possible movement directions: up, down, left, right
    const dirs = [
        [1, 0],  // Down
        [-1, 0], // Up
        [0, 1],  // Right
        [0, -1], // Lef

Passenger Issues

### Passenger / Engineyard
- Updating ruby version in EY environment, then deployed
  - EY succeeds but site won't load
  - Passenger log says:
```
passenger Could not spawn process for application /data/FSIWorldwide/current: The application encountered the following error: 
Could not find rails-7.0.8.7 in any of the sources (Bundler::GemNotFound)
```
  - Upon closer look, references previous ruby gem version
#### SOLUTION: kill passenger process and redeploy
- `ps aux | grep passenger`
- Look f

How to checkout a tag in git?

git checkout <tag-name>

# However, note that this puts your repo in a "detached HEAD" state, meaning you're not on a branch, and any new commits won't belong to any branch unless you create one.

Abstração

# Enredo
Abstração em Java é o conceito de ocultar detalhes de implementação e expor apenas as funcionalidades essenciais de um objeto, utilizando classes abstratas e interfaces para definir comportamentos sem especificar como eles são implementados.

## Conceito de Abstração em POO
A Abstração envolve a identificação e a modelagem das características e comportamentos essenciais de um objeto, ignorando os detalhes irrelevantes ou secundários para o contexto em questão. Em essência, a abstração p

Throttle

function throttle(fn, delay) {
  let lastCall = 0;

  return function (...args) {
    const now = new Date().getTime();

    if (now - lastCall >= delay) {
      lastCall = now;
      fn.apply(this, args);
    }
  };
}

3341. Find Minimum Time to Reach Last Room I

There is a dungeon with n x m rooms arranged as a grid. You are given a 2D array moveTime of size n x m, where moveTime[i][j] represents the minimum time in seconds when you can start moving to that room. You start from the room (0, 0) at time t = 0 and can move to an adjacent room. Moving between adjacent rooms takes exactly one second. Return the minimum time to reach the room (n - 1, m - 1). Two rooms are adjacent if they share a common wall, either horizontally or vertically.
/**
 * Finds the minimum time required to reach the bottom-right cell of the grid.
 * Each cell contains a time constraint that dictates the earliest possible arrival.
 *
 * @param {number[][]} moveTime - A 2D array representing the minimum time required 
 *                                to step into each cell.
 * @return {number} - The minimum time required to reach the last cell, or -1 if unreachable.
 */
var minTimeToReach = function(moveTime) {
    const rows = moveTime.length;
    const co

CSSで楕円のスムージング

<div class="radius">Squircle</div>