Skip to content

Instantly share code, notes, and snippets.

View olexs's full-sized avatar

Olex S. olexs

View GitHub Profile
@olexs
olexs / jarolift.yaml
Created August 16, 2022 15:23
ESPHome setup for wired-on Jarolift window cover RF remote
esphome:
name: esphome-32-jarolift
on_boot:
priority: 600
then:
- output.turn_off: hcs361_s3
- output.turn_off: hcs361_s2
- output.turn_off: hcs361_s1
- output.turn_off: hcs361_s0
@olexs
olexs / pdf2jpg4fax.bat
Created May 23, 2021 13:35
Convert a PDF to JPG image(s) optimized for quick transfer via fax (specifically Fritz!Box built-in fax)
@echo off
setlocal enabledelayedexpansion
:top
if (%1) == () goto end
echo Extracting single page images from "%1"...
"imagemagick\convert.exe" -density 150 %1 "%~dpn1.fax.bmp"
for %%f in (.\*.fax*.bmp) do (
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>
#include <WiFiClientSecure.h>
#include <ArduinoJson.h>
// WiFi access data
const char *ssid = "WIFI_SSID";
const char *password = "WIFI_PASSWORD";
#!/bin/bash
#
# Batch Time-Lapse creation script.
#
# This script can be used to speed up, trim, and finally concatenate tens or
# even hundreds of video clips, e.g. from a dash cam. You can do other things,
# too, but the main things this script does include:
#
# 1. Copy across and speed up video clips from an input dir to an output dir.
# 2. Trim off the first x frames of each of the copied/sped up clips.
@olexs
olexs / thrust-plot.py
Created December 8, 2015 19:36
Motor thrust/efficiency plotter script
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
InterpolatedToFile = "plot.png"
MotorPropThrust = np.array([34, 77, 127, 198, 266, 354, 457, 555, 689, 805, 943, 1064, 1136, 1330])
MotorPropAmps = np.array([0.23, 0.48, 0.74, 1.15, 1.67, 2.41, 3.42, 4.29, 5.91, 7.59, 9.24, 10.48, 12.76, 16.38])
@olexs
olexs / mini-ecalc.py
Created November 21, 2015 21:53
Script for generating a Lipo table and TWR vs. flight time scatter graph
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MultipleLocator, FormatStrFormatter
# http://godsnotwheregodsnot.blogspot.ru/2013/11/kmeans-color-quantization-seeding.html
Colormap = ["#FFFF00", "#1CE6FF", "#FF34FF", "#FF4A46", "#008941", "#006FA6", "#A30059",
"#FFDBE5", "#7A4900", "#0000A6", "#63FFAC", "#B79762", "#004D43", "#8FB0FF", "#997D87",
"#5A0007", "#809693", "#FEFFE6", "#1B4400", "#4FC601", "#3B5DFF", "#4A3B53", "#FF2F80",
"#61615A", "#BA0900", "#6B7900", "#00C2A0", "#FFAA92", "#FF90C9", "#B903AA", "#D16100",