Skip to content

Instantly share code, notes, and snippets.

const {binary, temperature, humidity, numeric, battery} = require('zigbee-herdsman-converters/lib/modernExtend');
const definition = {
zigbeeModel: ['Alab-PhSensor-1.0'],
model: 'Alab-PhSensor-1.0',
vendor: 'Alab',
description: '[DiY Wireless PH Sensor](https://github.com/9zigen/zigbee-ph-sensor)',
extend: [
temperature(),
humidity(),
#include <stdio.h>
#include <adc.h>
#include <device.h>
#include <math.h>
#include <sensor.h>
#include <zephyr.h>
#include <gpio.h>
#include <nrf_saadc.h>
@jfierstein
jfierstein / check_mail.py
Created April 22, 2019 05:01
Python script for scraping Gmail inbox for Amazon package emails with today as delivery date (written for Home Assistant)
import sys, smtplib, time
import datetime
import imaplib
import email
import json
EMAIL = "<YOURADDRESS>@gmail.com"
PWD = "<YOURSECRETPASSWORD>"
SMTP_SERVER = "imap.gmail.com"
SMTP_PORT = 993
@mcfrojd
mcfrojd / Shield_Intents.MD
Last active June 8, 2025 15:26
Working INTENTS to use with Community Hass.io Add-ons: Android Debug Bridge for your Nvidia Shield TV

Latest Update 2021-03-06 : New image showing the new "Services" in Home Assistant and got some tips from the comments below.

Credits and thanks: Home Assistant Forum users & Github users: @ocso, @wiphye, @teachingbirds, @tboyce1, @simbesh, @JeffLIrion @ff12 @rebmemer @siaox @DiederikvandenB @Thebuz @clapbr @Finsterclown


Start apps on your android device (in the examples below, my Nvidia Shield TV) from Home Assistant

alt text

Starts Youtube App

entity_id: media_player.shield
command: >-
@rsnk96
rsnk96 / multiprocessing_cv.py
Last active September 9, 2020 08:36
Outline of a parallelized video processing code
def process_video(group_number):
cap = cv2.VideoCapture("input_file.mp4")
cap.set(cv2.CAP_PROP_POS_FRAMES, frame_jump * group_number)
proc_frames = 0
out = cv2.VideoWriter("output_{}.avi".format(group_number), ...)
while proc_frames < frame_jump:
ret, frame = cap.read()
# ... DO SOME STUFF TO frame ... #
proc_frames += 1
out.write(frame)
@willprice
willprice / README.md
Last active April 28, 2025 16:42
Install OpenCV 4.1.2 for Raspberry Pi 3 or 4 (Raspbian Buster)

Install OpenCV 4.1.2 on Raspbian Buster

$ chmod +x *.sh
$ ./download-opencv.sh
$ ./install-deps.sh
$ ./build-opencv.sh
$ cd ~/opencv/opencv-4.1.2/build
$ sudo make install
@ValCanBuild
ValCanBuild / BottomNavigationBehavior.kt
Last active December 18, 2023 00:04
Full code of a BottomNavigationBehavior which hides itself on scroll and handles Snackbars, FAB and snapping. https://medium.com/@ValCanBuild/scroll-your-bottom-navigation-view-away-with-10-lines-of-code-346f1ed40e9e
/**
MIT License
Copyright (c) 2018 Valentin Hinov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@alex-spataru
alex-spataru / A QML Material Drawer.md
Last active August 8, 2024 02:04
Implementation of a simple and clean Material drawer for your QtQuick/QML applications

Description

This gist allows you to implement a material drawer easily for your projects. It consists of three files:

  • PageDrawer.qml The drawer itself, with an icon viewer, a list view and some hacks to execute the actions/functions assigned to each drawer item
  • DrawerItem.qml Which can act as an action, a spacer, a separator or a link
  • SvgImage.qml Ugly hack to make SVG images look crisp and smooth on HDPI screens

Licence

This code is released under the WTFPL, for more information click here.

@ric96
ric96 / main.c
Created December 3, 2017 17:00
hcsr04 sample code for zephyr on 96b_carbon
#include <zephyr.h>
#include <misc/printk.h>
#include <device.h>
#include <gpio.h>
#include <sys_clock.h>
#include <misc/util.h>
#include <limits.h>
#define GPIO_OUT_PIN 1
#define GPIO_INT_PIN 3