-
Установить и запустить MailHog
brew install mailhog brew services start mailhog
-
Добавить настройки в файл
/Applications/MAMP/bin/php/{PHP_VERSION}/conf/php.ini
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WooCommerce EDI 1c: hacks | |
* Description: Настройки и исправления ошибок плагина | |
* Version: 0.0.1 | |
* License: GPLv2 or later | |
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
* Author: PopArtDesign <[email protected]> | |
* Author URI: https://popartdesign.ru/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Parsers/ProductImagesParser.php b/src/Parsers/ProductImagesParser.php | |
index 8b13cb9..67505a0 100644 | |
--- a/src/Parsers/ProductImagesParser.php | |
+++ b/src/Parsers/ProductImagesParser.php | |
@@ -69,7 +69,7 @@ class ProductImagesParser { | |
$guid | |
); | |
- if ( is_null( $image_id ) ) { | |
+ if ( is_null( $image_id ) || ! Utils::post_exists( $image_id ) ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: WooCommerce EDI 1C: product code | |
* Description: Сохраняет код товара из 1С в метаданных товара | |
* Version: 0.0.1 | |
* License: GPLv2 or later | |
* License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html | |
* Author: PopArtDesign <[email protected]> | |
* Author URI: https://popartdesign.ru/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('woocommerce_single_product_image_thumbnail_html', 'app_remove_repeated_featured_image_from_product_gallery', 10, 2); | |
function app_remove_repeated_featured_image_from_product_gallery( $html, $attachment_id ) { | |
global $product; | |
static $counter = 0; | |
if ( get_post_thumbnail_id( $product->get_id() ) == $attachment_id ) { | |
$counter++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Encore = require('@symfony/webpack-encore'); | |
if (!Encore.isRuntimeEnvironmentConfigured()) { | |
Encore.configureRuntimeEnvironment(process.env.NODE_ENV || 'dev'); | |
} | |
Encore | |
.setOutputPath('public/build/') | |
.setPublicPath('/build') | |
.addEntry('app', './assets/js/app.js') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stddef.h> | |
#include "xor.h" | |
void *memxor(void *s, size_t ssize, void *k, size_t ksize) | |
{ | |
unsigned char *sp = s; | |
unsigned char *kp = k; | |
for (size_t i = 0; i < ssize; ++i) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctype.h> | |
int fuzzy_match(const char *needle, const char *haystack) | |
{ | |
while (*needle && *haystack) { | |
if (*haystack == tolower(*needle) || *haystack == toupper(*needle)) { | |
needle++; | |
} | |
haystack++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
binary="${1:-./a.out}"; | |
test() { | |
input="$1"; | |
expected="$2"; | |
actual="$(echo $input | $binary)"; | |
if [ "$expected" = "$actual" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$routes = [ | |
'GET /' => function (string $method, array $params) { | |
echo 'Welcome!'; | |
}, | |
'(GET|POST) /hello(/(?<name>[^/]++))?' => function (string $method, array $params) { | |
\printf('Hello, %s!', $params['name'] ?? 'World'); | |
}, | |
]; |
NewerOlder