Skip to content

Instantly share code, notes, and snippets.

View h4's full-sized avatar
💭
I may be slow to respond.

Mikhail Baranov h4

💭
I may be slow to respond.
View GitHub Profile
@h4
h4 / demo.ino
Created November 13, 2020 11:28
/*
Created 2016
by AlexGyver
AlexGyver Home Labs Inc.
*/
char masschar[5]; //массив символов для перевода
String massstring; //строка, в которую задаётся масса в режиме выбора массы
int set,setmass,rapidtime;
boolean initial,flagmass, flagmassset, rapidflag; //флажки
int n=1; //номер выстрела, начиная с 1
@h4
h4 / rename.py
Created May 28, 2020 14:53
Rename alembic revisions with new format
#!/usr/bin/env python3
import subprocess
import time
from os import walk, path, chdir
import re
regex = re.compile(r'([0-9a-f]+)_(\w+)\.py')
date_re = re.compile(r'(\d+)-(\d+)-(\d+) (\d+):(\d+)')
chdir('/alembic_/versions')
for root, dirs, files in walk('/alembic_/versions'):
def sum(a, b):
return a + b
print(sum(1, 3))
@h4
h4 / ClearGrass.txt
Last active November 4, 2019 20:43
Xiaomi BLE Temperature/Humidity Sensors
00001800-0000-1000-8000-00805f9b34fb Generic Access
00002a00-0000-1000-8000-00805f9b34fb READ WRITE
b'ClearGrass Temp & RH'
Device Name
00002a01-0000-1000-8000-00805f9b34fb READ
b'\x00\x00'
Appearance
00002a04-0000-1000-8000-00805f9b34fb READ
b'\x10\x00<\x00\x00\x00\x90\x01'
Peripheral Preferred Connection Parameters
@h4
h4 / yields.csv
Last active October 26, 2019 19:23
SECID SHORTNAME PREVWAPRICE YIELDATPREVWAPRICE LOTSIZE COUPONPERCENT NUMTRADES
RU000A0JU0S6 УВЗ Б01 100.65 8.53 1 9.35 73
RU000A0JVJ45 НовикомБО5 100 8.03 1 7.9 3
RU000A0JU898 МКБ БО-09 101.06 7.75 1 10.25 7
RU000A0JR1Z4 ФСК ЕЭС-07 100 7.63 1 7.5 0
RU000A0JR1Z4 ФСК ЕЭС-07 100 7.63 1 7.5 0
RU000A0JR1Z4 ФСК ЕЭС-07 100 7.63 1 7.5 0
RU000A0ZYBG6 РосбнБ1P1 100.86 7.51 1 8.35 5
RU000A0JVSY3 Удмурт2015 105.7 7.4 1 13.8 30
RU000A0JR217 ФСК ЕЭС-10 100.5 7.38 1 7.75 0
Param Value
SECID RU000A100VR4
BID None
BIDDEPTH None
OFFER None
OFFERDEPTH None
SPREAD 0
BIDDEPTHT None
OFFERDEPTHT None
OPEN 104.57
sensor:
- platform: template
sensors:
livingroom_battery:
friendly_name: "Humid Battery Level"
value_template: "{{ states.sensor.humidity_158d00020ec3e3.attributes.battery_level }}"
unit_of_measurement: '%'
@h4
h4 / MJ_HT_V1.txt
Created May 21, 2019 14:04
MJ_HT_V1 sensor available characteristics
Service: 00001800-0000-1000-8000-00805f9b34fb
Characteristic: 00002a00-0000-1000-8000-00805f9b34fb
READ WRITE
b'MJ_HT_V1'
Characteristic: 00002a01-0000-1000-8000-00805f9b34fb
READ
b'\x00\x03'
Characteristic: 00002a04-0000-1000-8000-00805f9b34fb
READ
b'\x10\x00<\x00\x00\x00\x90\x01'
@h4
h4 / LYWSD02.txt
Created May 20, 2019 06:48
LYWSD02 sensor available characteristics
Service: 00001800-0000-1000-8000-00805f9b34fb
Characteristic: 00002a00-0000-1000-8000-00805f9b34fb
READ
b'LYWSD02'
Characteristic: 00002a01-0000-1000-8000-00805f9b34fb
READ
b'\x00\x00'
Service: 00001801-0000-1000-8000-00805f9b34fb
Characteristic: 00002a05-0000-1000-8000-00805f9b34fb
READ INDICATE