Configuring your dev environment to be able to use xdebug when you're working on Windows 10 (with WSL2) and Docker with VS Code can be (a bit) tricky.
This is a quick reminder of how I've done that.
- Install and configure xdebug in Docker
| <?php | |
| /** | |
| * Set redis configuration. | |
| */ | |
| /** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */ | |
| if (extension_loaded('redis')) { | |
| // Set Redis as the default backend for any cache bin not otherwise specified. | |
| // $settings['cache']['default'] = 'cache.backend.redis'; |
Configuring your dev environment to be able to use xdebug when you're working on Windows 10 (with WSL2) and Docker with VS Code can be (a bit) tricky.
This is a quick reminder of how I've done that.
| /** | |
| * Send Google analytics tracking event. | |
| * | |
| * @param mixed $action | |
| * Event action. | |
| */ | |
| public function sendGoogleTrackingEvent($action) { | |
| if (!$this->isProduction()) return; | |
| $googleAnalyticsUA = 'UA-XXXXXXXX-XX'; |
В поддержку «Дадаты» иногда обращаются с вопросом «как проверить, является ли физлицо самозанятым». Налоговая служба не предоставляет открытых данных по самозанятым, поэтому такого сервиса нет в «Дадате».
Но можно воспользоваться API налоговой. Мы подготовили примеры, как это сделать на самых популярных языках — Python, PHP и JavaScript.
API налоговой бесплатное, но используете его вы на свой страх и риск. Никто не гарантирует, что оно будет работать корректно и стабильно.
Пример ответа API налоговой, если ИНН принадлежит самозанятому:
| server { | |
| server_name svkote.cyberlex404.com www.svkote.cyberlex404.com; | |
| charset off; | |
| index index.php index.html; | |
| disable_symlinks if_not_owner from=$root_path; | |
| include /etc/nginx/vhosts-includes/*.conf; | |
| include /etc/nginx/vhosts-resources/svkote.cyberlex404.com/*.conf; | |
| access_log /var/www/httpd-logs/svkote.cyberlex404.com.access.log; | |
| error_log /var/www/httpd-logs/svkote.cyberlex404.com.error.log notice; | |
| ssi on; |
/**
* Helper function for HOOK_Update to update the field schema columns.
*
* Based on address.install (thanks to the maintainer!)| <?php | |
| function _load_header_image($variables) { | |
| if ($node = $variables['node']) { | |
| // Load main_image | |
| $file = $node->field_main_image->entity; | |
| if ($file) { | |
| $variables = array( | |
| 'responsive_image_style_id' => 'header_image', | |
| 'uri' => $file->getFileUri(), |
| # ssh-copy-id analog for Windows systems | |
| # Script to install your public key on a remote machine | |
| # The remote machine must accept password authentication, | |
| # or one of the other keys in your Putty Agent, for this to work. | |
| # | |
| # (c) soar - http://soar.name | |
| # Dialog for public key selection | |
| Function Select-File() | |
| { |