Skip to content

Instantly share code, notes, and snippets.

@wizhippo
wizhippo / quadrature_encoder.pio
Created August 3, 2023 20:25
pi pico quad with set counter
;
; Copyright (c) 2023 Raspberry Pi (Trading) Ltd.
;
; SPDX-License-Identifier: BSD-3-Clause
;
.program quadrature_encoder
; the code must be loaded at address 0, because it uses computed jumps
.origin 0
@wizhippo
wizhippo / notes.md
Last active October 20, 2023 20:11
pilot quick calc

Desent

Rate of descent standard 3deg

Ground speed * 5 or Ground speed / 2 add zero

Example: 200 * 5 = 1000fpm or 200/2 = 100 * 10 = 1000fpm, I find dividing by 2 faster then multiplying by 5

TOD standard 3deg

Starting alt – Desired alt = delta feet x 3 = distance in feet / 1000 = NM

<?php
namespace EasyCorp\Bundle\EasyAdminBundle\Field;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldInterface;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\EaFormPanelType;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\EaFormRowType;
use EasyCorp\Bundle\EasyAdminBundle\Form\Type\EasyAdminTabType;
use Symfony\Component\Uid\Ulid;
<article class="view-type view-type-{{ view_type }} {{ content.contentType.identifier|replace({'_': '-'}) }}">
<div class="title file mime-type-{{ content.getField('file').value.mimeType|replace({'/': '-'})|replace({'.': '-'}) }}">
{{ ez_render_field(content, 'file') }}
</div>
<div class="info">
{{ content.contentType.name }}
</div>
</article>
<?php
namespace App\EasyAdmin\Filter;
use Doctrine\ORM\Query\Expr\Orx;
use Doctrine\ORM\QueryBuilder;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Filter\FilterInterface;
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\FilterDataDto;
@wizhippo
wizhippo / AutocompleteEntityFilter.php
Last active March 8, 2024 13:12
Start of adding autocomplete support to EntityFilter
<?php
namespace App\EasyAdmin\Filter;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\DBAL\Types\Type;
use Doctrine\ORM\Mapping\MappingException;
use Doctrine\ORM\Query\Expr\Orx;
use Doctrine\ORM\QueryBuilder;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Filter\FilterInterface;
<?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;
@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 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 / 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),