Skip to content

Instantly share code, notes, and snippets.

View a-x-'s full-sized avatar
🛩️

Alexander a-x-

🛩️
View GitHub Profile
@a-x-
a-x- / ir_led.esphome.yaml
Last active April 5, 2021 15:40
ir transmitter for samsung tv q9 and sven 5.1 audio; led highlight under couch
esphome:
name: esp_living_couch1
platform: ESP8266
board: d1_mini
wifi:
ssid: "grove"
password: "0My%Secur"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
@a-x-
a-x- / esphome-mh-z19b.yaml
Last active April 1, 2021 17:03
ESPHome CO₂ Sensor (MH-Z19B) Part of Config
#
# CO2 Sensor
# После прошивки надо выставить в открытое окно и выполнить эту команду ручного сброса нуля, которое запомнится в датчике
# HA > Developer tools > Call Service > Name: service.<ESP_NAME>_mhz19_calibrate_zero
api:
services:
- service: mhz19_calibrate_zero
then:
- mhz19.calibrate_zero: sensor_mhz19
title: Home
views:
- title: Домофон
path: ''
icon: 'hass:phone'
badges: []
cards:
- type: entities
entities:
- entity: binary_sensor.domofon_incoming_call
@a-x-
a-x- / Flow.tsx
Created September 10, 2020 23:32
Поток вёрстки — React обёртка над flexbox. <Flow row size="1rem"><Button/><Button/></Flow>
import React, { ReactNode } from 'react'
import styled from 'styled-components'
/** Nice flexbox wrapper */
type CrossAlign = 'start' | 'end' | 'center' | 'stretch' | 'baseline'
export interface FlowProps {
children: ReactNode
// direction shortcut
row?: boolean
type BankCode =
| 'Alfa'
| 'Baltiyskiy'
| 'Binbank'
| 'Europe'
| 'Gazprombank'
| 'HomeCredit'
| 'Mdm'
| 'Mkb'
| 'Moscow'
@a-x-
a-x- / Flow.tsx
Last active July 21, 2020 14:26
Flexbox wrappper for React
import React, { ReactNode } from 'react';
import styled from 'styled-components';
/**
* Nice flexbox wrapper
* @example <Flow col size="1rem">...</Flow> // 1rem = 1unit = 8px
*/
interface Props {
children: ReactNode,
#
# RubyReactAdmin. ActiveAdmin like controller API, возвращающее TR-D json
# для отображения React-интерфейсе без js-кода для дефолтных сценариев
# с несложными кастомизациями фронта по необходимости лучшими фронтовыми технологиями
#
# todo: render_json, render_json_error, render_json_exception
# todo:
module Admin
@a-x-
a-x- / hypenate-huefikate-cyrillic-ru.js
Last active January 26, 2021 10:02
Хуификатор учитывающий почти все набросы из статьи https://alejo.livejournal.com/57859.html И тут же реализация алгоритма разбиения на слоги
/*
https://sites.google.com/site/foliantapp/project-updates/hyphenation
*/
function hypenate (word) {
return _substitute(Array.from(word).reduce((res, c) => {
return _substitute(res) + c;
}, ''));
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@a-x-
a-x- / index.html
Last active June 3, 2019 20:06
golang wasm. go <-> js interlop
<html>
<head>
<meta charset="utf-8">
<script src="wasm_exec.js"></script>
<script>
const go = new Go();
WebAssembly.instantiateStreaming(fetch("main.wasm"), go.importObject).then((result) => {
go.run(result.instance);
console.log(Template('123', "Цифры из этого смс никому нельзя сообщать. Для входа в приложение Рокетбанка введите код {{ index . 0 }}"));