Skip to content

Instantly share code, notes, and snippets.

View maksimerohin's full-sized avatar

Maksim Erokhin maksimerohin

  • Siberia, Novosibirsk
View GitHub Profile
https://kirillbdev.pro/kak-ubrat-polya-oformleniya-zakaza-woocommerce/
add_filter('woocommerce_checkout_fields' , 'kirillbdev_customize_checkout_fields');
function kirillbdev_customize_checkout_fields($fields) {
unset($fields['billing']['billing_company']);
unset($fields['billing']['billing_address_2']);
return $fields;
}
do_action('wpml_add_language_selector');
<div class="bg-gray-200" x-data="{ showBar: false }">
<nav
class="w-full py-4 text-center fixed text-xs font-semibold"
:class="{ 'bg-white shadow transition duration-100' : showBar }"
@scroll.window="showBar = (window.pageYOffset > 20) ? true : false"
>
MENU
</nav>
</div>
@maksimerohin
maksimerohin / BulkActions.md
Last active June 30, 2023 16:07
[Laravel Livewire Tables] Rappasoft Tables #laravel #livewire

Creating bulk actions

To create bulk actions, you must specify a method and a button title in the $bulkActions component property.

public array $bulkActions = [
    'exportSelected' => 'Export',
];

The following method is only available in v1.16 and above

Application cache

The application cache is the primary cache in Laravel. It stores everything that you manually cache in your application. You can clear only specific elements of the cache if you use tags or different cache stores. The easiest way to clear the Laravel cache is via artisan:

Clear Laravel cache via artisan command

php artisan cache:clear

If you use multiple caches and you want to clear a specific store, you can pass this as a parameter to the command:

php artisan cache:clear --store=redis

/*
/-------------------
/ app/Enums/Role.php
/-------------------
*/
namespace App\Enums;
enum Role: string
{

Начиная с Laravel 9.14 теперь есть возможность добавлять комментарии в MySQL- и PostgreSQL-таблицы

Schema::table('posts', function(Blueprint $table) {
  $table->comment('This is a table comment');
  $table->string('name')->comment('This is a column comment');

});

jQuery(thumbnails).attr("data-fancybox","gallery").getTitle();
jQuery(thumbnails).addClass("fancybox").attr("rel","fancybox").getTitle();
jQuery"a:has(img)[href$='.jpg']").addClass"fancybox").attr("rel","fancybox").getTitle();
jQuery(".wp-block-gallery a:has(img)[href$='.jpg']").addClass("fancybox").attr("data-fancybox","fancybox").getTitle();

UPDATE wp_options SET option_value = replace(option_value, 'old_value', 'new_value') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'old_value','new_value');
UPDATE wp_posts SET post_content = replace(post_content, 'old_value', 'new_value');

UPDATE wp_options SET option_value = replace(option_value, 'http://sam136f4.beget.tech', 'https://mag-rf.ru/') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://sam136f4.beget.tech','https://mag-rf.ru/');
UPDATE wp_posts SET post_content = replace(post_content, 'http://sam136f4.beget.tech', 'https://mag-rf.ru/');