Skip to content

Instantly share code, notes, and snippets.

View kabbi's full-sized avatar

Dmitry Kabak kabbi

View GitHub Profile
http://miot-spec.org/miot-spec-v2/instances?status=all
http://miot-spec.org/miot-spec-v2/instances?status=debug
http://miot-spec.org/miot-spec-v2/instances?status=released
and for example air purifier 3 cn (zhimi.airpurifier.ma4)
https://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:air-purifier:0000A007:zhimi-ma4:1
http://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:light:0000A001:philips-bulb:1
http://miot-spec.org/miot-spec-v2/instance?type=urn:miot-spec-v2:device:fan:0000A005:zhimi-sa1:1
@Bktero
Bktero / sizeof_compile_time.c
Last active March 23, 2024 23:45
[C][C++] Print size of type at compile time
char (*__kaboom)[sizeof( xxx )] = 1;
// xxx can be a variable or a data type
// See https://stackoverflow.com/questions/20979565/how-can-i-print-the-result-of-sizeof-at-compile-time-in-c
// Exemple of code:
// char (*__kaboom)[sizeof( long long )] = 1;
// GCC error:
// error: invalid conversion from 'int' to 'char (*)[8]' [-fpermissive]
// So sizeof(long long) == 8
import React from 'react'
const loaders = ['⣾', '⣽', '⣻', '⢿', '⡿', '⣟', '⣯', '⣷']
export default class AsciiLoadingIndicator extends React.Component {
state = {
loaderIndex: 0
}
componentDidMount () {
@andrewharvey
andrewharvey / mapnik_render_static_map.py
Created October 16, 2011 10:31
Render a static map using Mapnik given centre, zoom and image width/height.
#!/usr/bin/env python
# This script is like generate_image.py from the OSM Mapnik code,
# but it renders based on a given centre point, zoom and final image pixel size
# Author: Andrew Harvey <andrew.harvey4@gmail.com>
# License: CC0 http://creativecommons.org/publicdomain/zero/1.0/
#
# To the extent possible under law, the person who associated CC0
# with this work has waived all copyright and related or neighboring