22. Generate Parentheses

Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.
/**
 * @param {number} n
 * @return {string[]}
 */
var generateParenthesis = function(n) {
    const result = [];

    function backtrack(current, open, close) {
        // If we've used all parentheses, save the combination
        if (current.length === n * 2) {
            result.push(current);
            return;
        }

        // Add an opening parenthesis if we still have some left
        if (open < n) {
            backtrack(current + "(", open + 1, close);
        }

        // Add 

Google Fonts

// Noto Sans JP(Google Fonts)
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@100..900&display=swap");

// poppins(Google Fonts)
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap');

CF7 Form

<div class="form-group">
    <label for="name" class="form-label">お名前 <span class="required">*</span></label>
    [text* your-name id:name class:form-control placeholder "お名前を入力してください"]
</div>

<div class="form-group">
    <label for="company" class="form-label">会社名</label>
    [text your-company id:company class:form-control placeholder "会社名を入力してください"]
</div>

<div class="form-group">
    <label for="email" class="form-label">メールアドレス <span class="required">*</span></label>
    [email* your-emai

20. Valid Parentheses

Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be closed by the same type of brackets. Open brackets must be closed in the correct order. Every close bracket has a corresponding open bracket of the same type.
/**
 * @param {string} s
 * @return {boolean}
 */
var isValid = function(s) {
    const stack = [];

    // Maps each closing bracket to its matching opening bracket
    const pairs = {
        ')': '(',
        '}': '{',
        ']': '['
    };

    for (const char of s) {
        // Opening bracket: save it for a future match
        if (!(char in pairs)) {
            stack.push(char);
        } else {
            // Closing bracket: must match the most recent opening bracket
            if (

ADMIN > Modifications for 'Subscriber' role || Series CPT content

add_action( 'admin_init', 'redirect_based_on_user_role', 100 );
function redirect_based_on_user_role() {
	if ( current_user_can( 'subscriber' ) ) {
		if (is_admin() AND !wp_doing_ajax()) {
			wp_redirect('/partner-portal/');
			exit;
		}
		/***
		 * CURRENTLY only the above code is being used
		 * The rest below will not be used as we are not allowing wp-admin access
		 * BUT is here for reference...
		 */
		
	}
}


add_action( 'template_redirect', function() {

	if ( is_user_

Get ACF repeater row number

add_shortcode('acf_row_number', function() {
    if ( function_exists('get_row_index') ) {
        return get_row_index(); // Returns 1, 2, 3...
    }
    return '';
});

FRONTEND > disable WordPress search queries and block the search results archive page

/**
 * Disable and block WordPress search queries and the search results archive.
 */
function disable_and_block_wp_search( $query, $error = true ) {
    if ( is_search() && ! is_admin() ) {
        $query->is_search = false;
        $query->query_vars['s'] = false;
        $query->query['s'] = false;
        
        // Block the archive and force a 404 Not Found error
        if ( $error == true ) {
            $query->is_404 = true;
            global $wp_query;
            $wp_q

threads calculated with patient number

WITH
-- ============================================================
-- CHANGE THE REPORT DATE RANGE HERE ONLY
-- ============================================================
date_range AS (
    SELECT
        DATE '2026-09-01' AS start_date,
        DATE '2026-09-30' AS end_date
),

anc_dedup AS (
    SELECT base_entity_id, MIN(date_created) AS anc_date
    FROM report.anc_register
    GROUP BY base_entity_id
),

ncd_regi_dedup AS (
    SELECT base_entity_id, MIN(date_created) AS ncd_regi_date

Link to Next Pagination

<?php
if ( get_previous_posts_link() ) :
    previous_posts_link( 'PREV' );
endif;
?>


<?php 
if ( get_next_posts_link() ) :
    next_posts_link( 'NEXT' ); 
endif; 
?>

Martians log

## View log via dmesg
```bash
dmesg | grep -i martian
```
or 
```bash
dmesg | grep -i rpfilter
```

## View log via journalctl
```bash
journalctl -k | grep -i martian
```
or 
```bash
journalctl -k | grep -i rpfilter
```
## Read log REALTIME
```bash
journalctl -kf | grep -i martian
```
or 
```bash
dmesg -w | grep -i martian
```

Navigation breakpoints for WP Block Theme

From Jakson's Youtube video - https://youtu.be/1M2g4e9vq4w?si=pV5ESugkGk0QrMN_
/* -- Navigation breakpoints -- */
/* 1. Global / Mobile State: Force the hamburger menu by default */
body .wp-block-navigation__responsive-container-open:not(.always-shown) {
	display: block !important;
}
body .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
	display: none !important;
}

/* .wp-block-navigation:not(.has-background) .wp-block-navigation__responsive-container.is-menu-open:not(.disable-default-overlay) {
    background-color: var(--wp--prese

1111. Maximum Nesting Depth of Two Valid Parentheses Strings

A string is a valid parentheses string (denoted VPS) if and only if it consists of "(" and ")" characters only, and: It is the empty string, or It can be written as AB (A concatenated with B), where A and B are VPS's, or It can be written as (A), where A is a VPS. We can similarly define the nesting depth depth(S) of any VPS S as follows: depth("") = 0 depth(A + B) = max(depth(A), depth(B)), where A and B are VPS's depth("(" + A + ")") = 1 + depth(A), where A is a VPS. For example, "", "()()", and "()(()())" are VPS's (with nesting depths 0, 1, and 2), and ")(" and "(()" are not VPS's. Given a VPS seq, split it into two disjoint subsequences A and B, such that A and B are VPS's (and A.length + B.length = seq.length). The subsequences may not necessarily be contiguous. For example, for the sequence 123456789, one possible split is: A = {1, 3, 5, 7, 9}, B = {2, 4, 6, 8}. This corresponds to the output [0, 1, 0, 1, 0, 1, 0, 1, 0] where 0 indicates membership in A and 1 indicates membership in B. Now choose any such A and B such that max(depth(A), depth(B)) is the minimum possible value. Return an answer array (of length seq.length) that encodes such a choice of A and B: answer[i] = 0 if seq[i] is part of A, else answer[i] = 1. Note that even though multiple answers may exist, you may return any of them.
/**
 * @param {string} seq
 * @return {number[]}
 */
var maxDepthAfterSplit = function(seq) {
    const ans = [];
    let depth = 0;

    for (const ch of seq) {
        if (ch === '(') {
            // Enter the next nesting level.
            depth++;

            // Alternate levels between A (0) and B (1).
            ans.push(depth % 2);
        } else {
            // Matching ')' belongs to the same group
            // as its corresponding '('.
            ans.push(depth % 2);

         

Bankstatements Knowledge

What are the steps:


Parser formats:
  gts rejections: 
    Leasing: 
      camt 053.001.08
      camt 054.001.02 file is just archived! So the "process" method just returns mono.empty.
    Financing:
      camt 053.001.08
      NO camt54!
  
  gts self-payer:
    Leasing and Financing: camt 053.001.08
    
  gts handling MT940
    Leasing:
      no parsing. Check if not xml, then assume it is MT940. Routing to DIRECT_GTS_TO_ALFA_ROUTE
  
  gps rejections:
    Leasing:
      pain00200103
    Fi

Returns boolean True/False of an environment variable (to be used in settings.py)

def env_to_bool(name, default=False):
    # returns boolean True/False of an environment variable
    # usage examples:
    #   env_to_bool("DEBUG")
    #   env_to_bool("DEBUG", default=True)
    # consider adding more options, like "on", "enabled", "y" etc.
    return os.environ.get(name, str(default)).strip().lower() in (
        "true", "yes", "1"
    )

2267. Check if There Is a Valid Parentheses String Path

A parentheses string is a non-empty string consisting only of '(' and ')'. It is valid if any of the following conditions is true: It is (). It can be written as AB (A concatenated with B), where A and B are valid parentheses strings. It can be written as (A), where A is a valid parentheses string. You are given an m x n matrix of parentheses grid. A valid parentheses string path in the grid is a path satisfying all of the following conditions: The path starts from the upper left cell (0, 0). The path ends at the bottom-right cell (m - 1, n - 1). The path only ever moves down or right. The resulting parentheses string formed by the path is valid. Return true if there exists a valid parentheses string path in the grid. Otherwise, return false.
/**
 * @param {character[][]} grid
 * @return {boolean}
 */
var hasValidPath = function(grid) {
    const m = grid.length;
    const n = grid[0].length;
    
    // 1. Quick initial checks
    if ((m + n - 1) % 2 !== 0) return false;
    if (grid[0][0] === ')' || grid[m - 1][n - 1] === '(') return false;
    
    // Max possible balance k cannot exceed (m + n) / 2
    const maxK = Math.floor((m + n) / 2) + 1;
    
    // Memoization table: memo[i][j][k] initialized to -1
    const memo = Array.f

RTL admin helpers for list display & forms

# /common/admin_helpers.py
# RTL admin helpers for list display & forms

"""
# Example usage in admin.py

from common.admin_helpers import rtl_list_field, rtl_form_field


class NotificationTypeAdminForm(forms.ModelForm):
    class Meta:
        model = NotificationType
        fields = "__all__"

        widgets = {
            "field1": rtl_form_field(), # default is text input
            "field2": rtl_form_field(forms.Textarea, rows=5), # change to textarea
            "fiel