NextJS debugging config for vscode

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "chrome",
      "request": "launch",
      "name": "Next: Chrome",
      "skipFiles": [
        "${workspaceFolder}/node_modules/**/*.js",
        "<node_internals>/**"
      ],
      "url": "http://localhost:5000/auth?shop=gropulse-app-test-1.myshopify.com",
      "webRoot": "${workspaceFolder}"
    },
    {
      "type": "node",
      "request": "launch",
      "name": "Next: Node",
      "skipFiles": [
      

Delete unnecessary files in Laravel

<?php

namespace App\Http\Controllers;

use App\Jobs\NoVisitReminderJob;
use App\Models\Faculty;
use App\Models\Footer;
use App\Models\Invite;
use App\Models\Resource;
use App\Models\TempFile;
use App\Models\Testimonial;
use App\Models\Toolkit;
use App\Models\VideoQuestionAnswer;
use Carbon\Carbon;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Storage;

class CronJobController extends Controller
{
    function deleteTempFIles()
    {
        $date = Carbon::now

Access the protected method

// How to access the protected method from outside the class.
$result = (fn() => $this->getMigrationIds())->call(\Drupal::service('weller_xml_importer.migrator'));
dump($result);

switch case if is_page, change ID

<?php

                global $post;
                // get all terms in the taxonomy
                $terms = get_terms( 'works_category' );
                // convert array of term objects to array of term IDs
                $term_ids = wp_list_pluck( $terms, 'term_id' );
                $id;


                switch ( $post->post_name ) {
                    case "electricity":
                        $id = 2;
                        break;
                    case "melting":
               

On grid layout, apply bottom margin to everything but the items on the last row

/* Our Services */
@media screen and (min-width: 40em) {
    .grid-container.our-services > .grid-x > .cell:not(:nth-last-child(-n+3)) {
        margin-bottom: 3rem;
    }
}
@media screen and (min-width: 64em) {
    .grid-container.our-services > .grid-x > .cell:not(:nth-last-child(-n+2)) {
        margin-bottom: 3rem;
    }
}
@media screen and (max-width: 39.9375em) {
    .grid-container.our-services > .grid-x > .cell:not(:last-child) {
        margin-bottom: 3rem;
    }
}

Custom styles for WordPress Editor (wysiwyg)

https://www.hostpapa.com/knowledgebase/how-to-add-custom-styles-to-wordpress-visual-editor/
/**
 * 
 */
function wpb_mce_buttons_2($buttons) {
	array_unshift($buttons, 'styleselect');
	return $buttons;
}
add_filter('mce_buttons_2', 'wpb_mce_buttons_2');

/*
* Callback function to filter the MCE settings
*/
function my_mce_before_init_insert_formats( $init_array ) {  
	$style_formats = array(  
		array(  
			'title' => 'Texto maiúsculo',  
			'block' => 'span',  
			'classes' => 'uppercase',
			'wrapper' => true,			
		),  
		/* array(  
			'title' => 'Blue Button', 

How to create a custom images?

create a file and name it Dockerfile

Add Gutenberg block styles to editor

1. Update config.json to include a new gutenberg.scss file. 2. Update setup.php to enqueue the new file. 3. Edit guternberg.scss, copy in any essential styles from main.scss. 4. Build the project again.
"gutenberg": [
  "./styles/gutenberg.scss"
],

test2 fsds

test2 fsds
import re

print("sdfsdf")

background-imageを画面解像度で出し分ける

<div class="background-switch"></div>

clean video ID for embedding

<?php
$yt_code = preg_replace( '/[^\d\w]/', '', $yt_code );

AJAX

<section class="section-news ajax-news">
    <div class="container">
        <div class="row ajax-result">

        <?php
        $news = new WP_Query(array(
            'post_type'         =>  'post',
            'posts_per_page'    =>  4
        ));
        if($news->have_posts()):
            $max_post_count = $news->post_count;

            while ($news->have_posts()):
                $news->the_post();
                // $thumb = wp_get_attachment_image_src( get_post_thumbnail

Posible problema Combine

menuPublisher.zip(searchPublisher)
            .map { menuItems in
                return NavigationBarState.menuLoaded(menuItems)
            }
            .subscribe(stateSubject)
            .store(in: &subscriptions)
            
            
en lugar de esto, sustituir por esto

menuPublisher.zip(searchPublisher)
            .map { menuItems in {
                return NavigationBarState.menuLoaded(menuItems)
            }
            .sink { [unowned self] event in
                self.sta

TS config

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "module": "NodeNext",
    "moduleResolution": "Node",
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noImplicitThis": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "skipLibCheck": true,
    "strict": true,
    "strictFunctionTypes": true,
    "target": "ES2020"
  },
  "include": [
    "*.ts",
    "**/*.ts"
  ],
  "exclude": [
    "node_modules/*"
  ]
}

non www to www redirect

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]

【three.js】Z軸なびき画像アニメーション

<canvas id="myCanvas"></canvas>