Skip to content

Instantly share code, notes, and snippets.

@wizhippo
wizhippo / FieldLike.php
Last active October 11, 2017 16:20
Solr FieldLike support
<?php
/**
* This file is part of the eZ Platform Solr Search Engine package.
*
* @copyright Copyright (C) eZ Systems AS. All rights reserved.
* @license For full copyright and license information view LICENSE file distributed with this source code.
*
* @version //autogentag//
*/
@wizhippo
wizhippo / error.log
Created October 25, 2017 20:54
cache clearing error
userx@userx-vb:~/src/ezsystems/ezplatform$ app/console -vvv cache:clear
[2017-10-25 16:53:00] app.DEBUG: Changing SiteAccess in view providers
[2017-10-25 16:53:00] event.DEBUG: Notified event "ezpublish.config.scope_change" to listener "eZ\Bundle\EzPublishCoreBundle\EventListener\ConfigScopeListener::onConfigScopeChange".
[2017-10-25 16:53:00] event.DEBUG: Notified event "ezpublish.config.scope_change" to listener "eZ\Bundle\EzPublishCoreBundle\EventListener\DynamicSettingsListener::onConfigScopeChange".
[2017-10-25 16:53:00] event.DEBUG: Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::configure".
[2017-10-25 16:53:00] event.DEBUG: Notified event "console.command" to listener "Symfony\Component\HttpKernel\EventListener\DumpListener::configure".
[2017-10-25 16:53:00] event.DEBUG: Notified event "console.command" to listener "Symfony\Bridge\Monolog\Handler\ConsoleHandler::onCommand".
[2017-10-25 16:53:00] event.DEBUG: Notified event "c
<?php
namespace EzSystems\EzPlatformAdminUi\Tab\Event\Subscriber;
use EzSystems\EzPlatformAdminUi\Tab\Event\TabEvents;
use EzSystems\EzPlatformAdminUi\Tab\Event\TabGroupEvent;
use EzSystems\EzPlatformAdminUi\Tab\TabRegistry;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class LocationViewTabSubscriber implements EventSubscriberInterface
<?php
declare(strict_types=1);
namespace AppBundle\Form\Extension;
use eZ\Publish\API\Repository\ContentTypeService;
use eZ\Publish\API\Repository\Values\ContentType\ContentType;
use EzSystems\EzPlatformAdminUi\Form\Type\ContentType\ContentTypeChoiceType;
use Symfony\Component\Form\AbstractTypeExtension;
// Commands for sending messages on an SPI bus
//
// Copyright (C) 2016 Kevin O'Connor <[email protected]>
//
// This file may be distributed under the terms of the GNU GPLv3 license.
#include <string.h> // memcpy
#include "board/gpio.h" // gpio_out_write
#include "basecmd.h" // oid_alloc
#include "command.h" // DECL_COMMAND
[mcu]
serial: /dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A906MI4K-if00-port0
pin_map: arduino
[tmc2130 stepper_x]
cs_pin: ar53
microsteps: 16
run_current: 1.000
hold_current: 0.500
@wizhippo
wizhippo / examples.php
Created October 11, 2019 18:58
TramsAPI examples
<?php
$result = $this->tramsAPIService->userProfileCreate([
'loginName' => $loginname,
'loginPassword' => $password,
'userName' => $agent->getCommonname(),
'CBOEnabled' => $agent->isEnabled() ? 'Y' : 'N',
'CBPEnabled' => $agent->isEnabled() ? 'X' : null,
'CBPDefAgentProfile_LinkNo' => $profile->getProfileNo(),
'CBPGroupSecurity_LinkNo' => $this->getSecurityLevel($agent),
<?php
namespace AppBundle\Security\Http\Firewall;
use eZ\Publish\API\Repository\Repository;
use eZ\Publish\Core\MVC\Symfony\Event\InteractiveLoginEvent;
use eZ\Publish\Core\MVC\Symfony\MVCEvents;
use eZ\Publish\Core\MVC\Symfony\Security\UserWrapped;
use eZUser;
use Psr\Log\LoggerInterface;
@wizhippo
wizhippo / c_cpp_properties.py
Created May 7, 2020 16:28 — forked from davidji/c_cpp_properties.py
Use the output from Chibios build to generate a VSCode configuration file
import subprocess, argparse, sys, pprint, json
from os import path
# Read the output of Chibios build to generate .vscode/c_cpp_properties.json
# E.g. make | python c_cpp_properties.py -C arm-none-eabi-g++ > .vscode/c_cpp_properties.json
parser = argparse.ArgumentParser()
parser.add_argument('-C', '--compiler', dest='compiler', default='arm-none-eabi-gcc')
parser.add_argument('-x', '--language', dest='language', default='c++')
<?php
namespace App\EventListener;
use eZ\Publish\API\Repository\Exceptions\NotFoundException;
use eZ\Publish\API\Repository\Repository;
use eZ\Publish\Core\MVC\Symfony\Event\InteractiveLoginEvent;
use eZ\Publish\Core\MVC\Symfony\MVCEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;