Skip to content

Instantly share code, notes, and snippets.

@nurikk
nurikk / README.md
Created June 14, 2018 07:09
Компилятоp С0 Д.Г. Хохлов
#!/usr/bin/env python3
import socket
HOST = ''
PORT = 26732
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
try:
s.bind((HOST, PORT))
s.listen()
conn, addr = s.accept()
<script>document.querySelector('.custom-file-input').addEventListener('change', function (e) { var fileName = document.getElementById("customFile").files[0].name; var nextSibling = e.target.nextElementSibling;nextSibling.innerText = fileName })</script>
#include <Arduino.h>
#include "WiFi.h"
// #include <WebServer.h>
#include <ArduinoJson.h>
#include <StreamUtils.h>
#include <esp_wifi.h>
#include <esp_event.h>
#include <esp_log.h>
#include <esp_system.h>
<main role="main" class="h-100">
<div class="w-100 mb-2" role="group">
<a class="btn btn-primary" href="/zigbee">Refresh</a>
<a class="btn btn-primary" href="/zigbee/groups">Groups</a>
<a class="btn btn-primary" href="/zigbee/map">Map</a>
<a class="btn btn-info" href="/zigbee/config">Setup</a>
<a class="btn btn-success" href="/zigbee?join=255">Join</a>
</div>
<div data-widget-host="zigbee"></div>
</main>
@nurikk
nurikk / API.md
Last active March 28, 2020 16:22

Файл менеджер апи

GET /api/files -- получить список файлов

GET /api/files?path=/

{
    "success": true,
    "result": [
 {
# IAR C-STAT and C-RUN
# Comment this out if you use C-Stat or C-Run to compile/analyze your project
*.ewt
# IAR Debugger files
*.ewd
# IAR Workspace files
*.eww
@nurikk
nurikk / dummy-converter.js
Created June 28, 2020 22:18
Example external converters
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
const getKey = (object, value) => {
for (const key in object) {
if (object[key] == value) return key;
}
};
const bind = async (endpoint, target, clusters) => {
for (const cluster of clusters) {
await endpoint.bind(cluster, target);
const {
fromZigbeeConverters,
toZigbeeConverters,
} = require('zigbee-herdsman-converters');
const ATTRID_MS_PRESSURE_MEASUREMENT_MEASURED_VALUE_HPA = 0x0200; // non standart attribute, max precision
const ZCL_DATATYPE_UINT32 = 0x23;
const bind = async (endpoint, target, clusters) => {
for (const cluster of clusters) {
@nurikk
nurikk / plan.md
Last active September 4, 2020 12:29
  1. Touchlink improvements: ⋅⋅⋅We need to add (3) new api's for Touchlink
 interface ScanResult {
     address: string | number;
 }

 interface Touchlink {
scanRequest(): Promise;