Skip to content

Instantly share code, notes, and snippets.

View Teagan42's full-sized avatar

Teagan Glenn Teagan42

View GitHub Profile
# Install Dependencies
sudo apt-get update
sudo apt-get -y --force-yes install autoconf automake build-essential libass-dev libfreetype6-dev \
libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev \
libxcb-xfixes0-dev pkg-config texinfo zlib1g-dev
mkdir /tmp/ffmpeg_sources
# YASM
sudo apt-get -y --force-yes install yasm
find $HOME/.steam/root/ubuntu12_32/steam-runtime/*/usr/lib/ -name "libstdc++.so.6" -exec mv "{}" "{}.bak" \; -print

Controller Limitations:

  • Console.log is unusuable in controller
  • Cannot throw errors explicitly
  • Controller can only contain methods, no constants (not sure about helper)

Component Limitations:

  • Cannot utilize javascript callouts
  • Cannot retrieve element from events, i.e. click a link
@Teagan42
Teagan42 / opencv.py
Created May 2, 2017 03:07
OpenCV camera
"""
Component that performs OpenCV classification on images.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/camera.opencv/
"""
import asyncio
import logging
from homeassistant.core import split_entity_id
@Teagan42
Teagan42 / example.yaml
Last active April 12, 2020 12:13
A custom camera component that allows you to see the detected regions from the OpenCV image processor in Home-Assistant. Add this to your configuration directory: {CONFIG_DIRECTORY}/custom_components/opencv.py
camera:
- platform: opencv
camera: camera.front_door
processor: image_processing.front_door_opencv_faces
# Optional Parameters
name: OpenCV Camera
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDLrWcrJDrq/7TLMqTTzIj3CqvthxxBFFwioafSDj0BaEy5e9gr3lYMjKuVMjMjA8h2RTgaXipoR6o2funSamHQ+li52QTlLLFAFgJXT3Rv2UscOAr+iNh22ka+PGnScwYNEEgmjeXcjRqpaeg2nDp0aVv0aCNvDji6u3s4bAr/ZopbwOzUVP9x8nrUCcXQvPGZxh2sPP5x1YUBa6AqSHk37c1zbHOzQPTcFmtjgzMSDkY464vqlEhb/AFzf/dwISGA27n/VqJkIV9wum8pt9fVNW/yco6X4ZBbOZTrcxwpBs70iLa3JcOsJhuE1hPxjYKjj3vGXSXTWJ2ZS8aZqK9n tglenn@mbp.int.teagantotally.rocks
@Teagan42
Teagan42 / gist:e4938bd9b880011cee68b6fb9baaab70
Last active December 17, 2018 21:15
isInitialized is always false when overriding a lateinit var
open class ParentClass {
open lateinit var property: String
val isInitialized: Boolean
get() = this::property.isInitialized
val isLateInit: Boolean
get() = this::property.isLateinit
}
@Teagan42
Teagan42 / Client.kt
Last active March 25, 2019 20:56
Quick Channel Wrapped MqttClient
package rocks.teagantotally.kotqtt.domain.framework.client
interface Client : MqttCommandExecutor, MqttEventProducer
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bash_profile
echo '[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm' >> ~/.bash_profile
echo '[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion' >> ~/.bash_profile
@Teagan42
Teagan42 / post-receive
Created May 28, 2019 01:48
Automatically Reload Home-Assistant Configuration on Git Push
#!/bin/bash
ha_container_name="home-assistant"
use_systemctl=0
docker exec $ha_container_name sh -c "python -m homeassistant -c /config --script check_config"
if [ $? -ne 0 ]; then
exit
fi