Skip to content

Instantly share code, notes, and snippets.

View maxistar's full-sized avatar
💭
doing things...

Maxim Starikov maxistar

💭
doing things...
View GitHub Profile
/**
* Returns of max profit for the given market values
* it there are not possible to compleat the deal it will return 0
*
* @param $marketValues the array wit market values, should contain at least one value
* @return int
*/
function getMaxProfit($marketValues) : int
{
$minValue = $marketValues[array_keys($marketValues)[0]];
#include <Wire.h>
#include <Adafruit_INA219.h> // You will need to download this library
Adafruit_INA219 sensor219; // Declare and instance of INA219
void setup(void)
{
Wire.begin(13, 15); //define which pins used for i2c
Serial.begin(9600);
/*
Simple script to send data to RequesBin
http://maxistar.ru/blog/%D0%9F%D0%BE%D1%81%D1%8B%D0%BB%D0%B0%D0%B5%D0%BC-%D0%B4%D0%B0%D0%BD%D0%BD%D1%8B%D0%B5-%D0%B2-%D0%BE%D0%B1%D0%BB%D0%B0%D0%BA%D0%BE/
The original script was found at https://RandomNerdTutorials.com/esp32-sim800l-publish-data-to-cloud/
Modified by Max Starikov
*/
// Your GPRS credentials (leave empty, if not needed)
// INA219 Current Sensor with OLED Display for Arduino Uno
//
// This sketch was modified from the Adafruit INA219 library example
//
// Gadget Reboot
//
// Required Libraries
// https://github.com/adafruit/Adafruit_INA219
// https://github.com/adafruit/Adafruit_SSD1306
/*
The TFT_eSPI library incorporates an Adafruit_GFX compatible
button handling class, this sketch is based on the Arduin-o-phone
example.
This example diplays a keypad where numbers can be entered and
send to the Serial Monitor window.
The sketch has been tested on the ESP8266 (which supports SPIFFS)
@maxistar
maxistar / antresol.scad
Created August 20, 2024 17:23
The Mezzanine
// see this https://maxistar.ru/blog/%D0%90%D0%BD%D1%82%D1%80%D0%B5%D1%81%D0%BE%D0%BB%D1%8C%D0%BA%D0%B0/
plate_thickness_16 = 1.6;
plate_thickness_19 = 1.9;
plate_minimal_width = 20;
// Hallway dimensions
hallway_width = 93; // cm
from telethon import TelegramClient
from telethon.tl.functions.messages import GetHistoryRequest
from datetime import datetime, timedelta, timezone
import asyncio
# Replace with your own API_ID and API_HASH
API_ID = '****'
API_HASH = '****'
CHANNEL_USERNAME = '****' # Example: '@channel_name'