Skip to content

Instantly share code, notes, and snippets.

View pinchoalex's full-sized avatar
🎯
Focusing

Alex Pinkevych pinchoalex

🎯
Focusing
View GitHub Profile
@pinchoalex
pinchoalex / main.cpp
Last active October 8, 2025 12:52
test
#include <Arduino.h>
#define PPM_OUT_PIN 25 // пин для выхода PPM
#define CHANNELS 8
#define FRAME_LENGTH 22500 // длина кадра ~22.5 мс
#define PULSE_LENGTH 400 // длина короткого импульса ~400 мкс
// Значения каналов (1000–2000 мкс)
int ppm[CHANNELS] = {1500, 1500, 1500, 1500, 1500, 1500, 1500, 1500};
# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details
# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1
# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#!/bin/bash
set -e
install_opencv () {
echo ""
case `cat /etc/debian_version` in
10*) echo "Detecting Debian 10, Buster. "
;;
11*) echo "Detecting Debian 11, Bullseye. "
;;
12*) echo "Detecting Debian 12, Bookworm. "
@pinchoalex
pinchoalex / main.cpp
Created March 13, 2024 14:51
main.cpp
#include <iostream>
#include <fstream>
#include <string>
#include <bcm2835.h>
using namespace std;
std::string getSerialNumber() {
std::ifstream file("/proc/cpuinfo");
std::string line;
const {initializeFirebaseApp} = require('firestore-export-import')
const serviceAccount = require('./src/config/pk.json')
const {backups} = require('firestore-export-import')
const fs = require('fs')
initializeFirebaseApp(serviceAccount)
backups().then((data) => {
const dateObj = new Date();
<br />
<b>Warning</b>: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in <b>/Users/mac/Documents/mamp-sites/tp/wp-content/plugins/travelpayouts/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php</b> on line <b>272</b><br />
<br />
<b>Warning</b>: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in <b>/Users/mac/Documents/mamp-sites/tp/wp-content/plugins/travelpayouts/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php</b> on line <b>275</b><br />
<br />
<b>Warning</b>: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in <b>/Users/mac/Documents/mamp-sites/tp/wp-content/plugins/travelpayouts/vendor/zendframework/zend-code/src/Reflection/MethodReflection.php</b> on line <b>281</b><br />
<br />
<b>Warning</b>: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in <b>/Users/mac/Documents/mamp-sites/tp/wp-content/plugins/travel
@pinchoalex
pinchoalex / metabox.php
Created February 25, 2019 12:43
Meta box add
<?php
//...
add_action( 'add_meta_boxes', 'adding_custom_meta_boxes', 10, 2 );
function adding_custom_meta_boxes( $post_type, $post ) {
add_meta_box( 'my-meta-box', 'Мой метаблок', 'render_my_meta_box', 'post', 'normal', 'default' );
}
function render_my_meta_box(){
echo '<div id="app">HTML метаблока</div>';
}
@pinchoalex
pinchoalex / Bookmarks.php
Last active February 3, 2019 10:39
Yii2 - получение данных в виде одномерного массива
<?php
public static function getUserBookmarksFileIds($user)
{
$result = self::find()->select('file_id')->where(['user_id' => $user])->asArray()->all();
$result = array_column($result, 'file_id');
return $result;
}
<?php
namespace content\modules\branches_queue;
abstract class AbstractExecutor implements ExecutorInterface
{
protected $db;
protected $prefix;
public $tableName;