View SmoothAdc.h
#pragma once | |
#include <driver/adc.h> | |
template<adc1_channel_t... PINS> | |
class SmoothAdc { | |
private: | |
const adc1_channel_t pins[sizeof...(PINS)] = {PINS...}; | |
volatile uint32_t results[sizeof...(PINS)] = {}; | |
uint16_t reads[sizeof...(PINS)][256] = {}; | |
uint8_t position = 0; |
View doctrine_live_tempaltes.xml
<template name="bool:default" value="/** * @var bool * @ORM\Column(type="boolean", options={"default": $default$}) */ private bool $$$name$ = $default$; $END$ public function is$method$(): bool { return $this->$name$; } public function set$method$(bool $$$name$): void { $this->$name$ = $$$name$; }" description="boolean column" toReformat="false" toShortenFQNames="true"> | |
<variable name="name" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="default" expression="enum("false", "true")" defaultValue="" alwaysStopAt="true" /> | |
<variable name="method" expression="capitalize(name)" defaultValue="" alwaysStopAt="false" /> | |
<context> | |
<option name="PHP Class Member" value="true" /> | |
</context> | |
</template> | |
<template name="bool:nullable" value="/** * @var bool|null * @ORM\Column(type="boolean", nullable=true) */ private ?bool $$$name$ = nul |
View StopwatchCompilerPass.php
<?php | |
namespace App\Service; | |
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; | |
use Symfony\Component\DependencyInjection\ContainerBuilder; | |
use Symfony\Component\DependencyInjection\Definition; | |
use Symfony\Component\DependencyInjection\Reference; |
View main.cpp
#include <Arduino.h> | |
#include <esp_pm.h> | |
void setup() | |
{ | |
Serial.begin(115200); | |
Serial.setDebugOutput(true); | |
esp_pm_lock_handle_t powerLock; | |
if (esp_pm_lock_create(ESP_PM_CPU_FREQ_MAX, 0, "", &powerLock) != ESP_OK) { |
View main.cpp
// This sketch shows how to read voltages from an esp32 | |
// Your ESP has to be manufactured in 2018 or newer for the values to be burned into eFuse. | |
// more infos here: | |
// https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html#adc-calibration | |
#include <Arduino.h> | |
#include <esp_adc_cal.h> | |
esp_adc_cal_characteristics_t chars; |
View remove-all-passwords.js
// $0 = <password-list-item> so you'll need to pick that element in your browser first | |
// then execute this script until your password list is empty (there is a timing issue but after about 3 tries the password list is empty) | |
$0.parentNode.querySelectorAll('password-list-item').forEach(item => { | |
item.shadowRoot.querySelector('#passwordMenu').click(); | |
item.parentNode.parentNode.parentNode.querySelector('#menuRemovePassword').click(); | |
}) |
View userscript.js
// ==UserScript== | |
// @name Bulk removal google hack | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Bulk remove a search result from google | |
// @author Marco Pfeiffer | |
// @match https://www.google.com/webmasters/tools/removals* | |
// @grant none | |
// ==/UserScript== |
View elevatorgame.js
{ | |
init: function(elevators, floors) { | |
this.elevators = elevators; | |
this.floors = floors; | |
this.todos = []; | |
this.time = 0; | |
this.overSizeTheashold = 6; | |
for (let floor of floors) { | |
floor.on('down_button_pressed', () => this.addFloorButtonPush(floor, 'down')); |
View AbstractDbalRepository.php
<?php | |
namespace Vendor\Extension\Domain\Repository; | |
use TYPO3\CMS\Core\Database\Connection; | |
use TYPO3\CMS\Core\Database\ConnectionPool; | |
use TYPO3\CMS\Core\Database\Query\QueryBuilder; | |
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction; | |
use TYPO3\CMS\Core\Utility\GeneralUtility; | |
use TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper; |
View poll.txt
/poll "Was wollen wir heute essen? | |
Ciao Bella: https://st-pauli.ciao-bella.de/mittagstisch/mittagstisch-der-woche.html | |
Taverna Romana: http://taverna-romana-hamburg.eu/our-menu/mittagstisch-menu/" "Ciao Bella (Italiener)" :pizza: "Döner/Paulis Kumpir (und Croque)/Thai Pauli" :stuffed_flatbread: "Azeitona (Falafel)" :broccoli: "Olympisches Feuer (Grieche)" :amphora: "Kleine Pause (Fast food)" :fries: "Asia Imbiss (Asiate)" :ramen: "Maharaja (Inder)" :curry: "Trattoria da Mario (Italiener)" :spaghetti: "Taverne Romana" :stew: "Graupi" :potato: |
NewerOlder