Skip to content

Instantly share code, notes, and snippets.

View thanksmister's full-sized avatar

Mister thanksmister

View GitHub Profile
@thanksmister
thanksmister / groups.yaml
Created October 15, 2018 22:50
Home Assistant Groups Yaml Exanple
default_view:
name: Home
view: yes
entities:
- group.heater_system
- group.alarm_system
- group.lights
- group.outside_cameras
- group.air_controls
@thanksmister
thanksmister / mosquitto.conf
Last active October 8, 2018 18:20
Snips Raspberry Pi Setup to talk with HA using intents (not as satellite).
# /etc/mosquitto/conf.d/mosquitto.conf
# Bridge to HA
connection snips-ha
# bridge_cafile /etc/mosquitto/
bridge_insecure true
address 192.168.86.228:1883
cleansession false
clientid snips
start_type automatic
#username _your user_
@thanksmister
thanksmister / MQTTSpeak.py
Last active August 21, 2022 21:11
Raspberry Pi, eSpeak, and MQTT
# Setup Raspberry Pi with WiFi
# Install Paho and eSpeak libraries for Raspberry Pi
# Run using "python3 MQTTSpeak.py"
# Import MQTT client.
import os
import time
import paho.mqtt.client as paho
# MQTT credentials
@thanksmister
thanksmister / DataService.java
Last active February 11, 2020 09:23
RxJava Polling Example
// data sevice class calling API and returning list of exchanges
public class DataService
{
private PublishSubject<List<Exchange>> exchangesRequest;
public DataService()
{}
// Get exchanges without any polling which returns results to subscription on time
public Subscription getExchanges(final Observer<List<Exchange>> observer)
@thanksmister
thanksmister / EllipsisTextView.java
Created October 16, 2012 23:10
Adds listener to Android TextView when text has ellipsis.
/**
* Author: Michael Ritchie, ThanksMister LLC
* Date: 10/16/12
* Web: thanksmister.com
*
* Extension of <code>TextView</code> that adds listener for ellipses changes. This can be used to determine
* if a TextView has an ellipses or not.
*
* Derived from discussion on StackOverflow:
*
@thanksmister
thanksmister / MaskedImage.as
Created September 11, 2012 19:28
Flex Spark Image Control with Skin to mask image with custom image mask file.
/**
* @authors Michael Ritchie
* @twitter @thanksmister
* @version Sept 11, 2012
*
* Use:
* <controls:MaskedImage source="assets/imageToMask.png" height="200" width="200" maskImage="assets/mask.png"/>
* The mask image can be any shaped, just make it in Photoshop, but should be smaller than the image you wish to mask.
* Try just making a black mask shape and saving it out as .png file with alpha.
* */
@thanksmister
thanksmister / ImageButton.as
Created January 17, 2012 18:29 — forked from pixels4nickels/ImageButton.as
Flex Spark Image Button component with rounded corners. Wraps the Image control and takes same source for image. .
/**
* @authors Michael Ritchie, Ken Rogers
* @twitter @thanksmister, @pixels4nickels
* @version Dec 9, 2011
* */
package
{
import flash.events.Event;
import mx.events.FlexEvent;
@thanksmister
thanksmister / ImageButton.as
Created December 11, 2011 22:09
Flex Spark Image Button component with rounded corners. Wraps the Image control and takes same source for image. .
/**
* @authors Michael Ritchie, Ken Rogers
* @twitter @thanksmister, @pixels4nickles
* @version Dec 9, 2011
* */
package
{
import flash.events.Event;
import mx.events.FlexEvent;
@thanksmister
thanksmister / ImageButtonSkin.mxml
Created December 10, 2011 17:44
Flex Spark Image component with skin to make rounded corners and border.
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
alpha.disabled="0.5" >
<fx:Metadata>[HostComponent("spark.components.Image")]</fx:Metadata>
<fx:Script>
<![CDATA[
@thanksmister
thanksmister / Main.mxml
Created November 25, 2011 22:05
Flex component to display modal popup windows that self-close on delay using the SkinnablePopUpContainer.
<?xml version="1.0" encoding="utf-8"?>
<!--
Michael Ritchie
mister@thanksmister.com
Copyright 2011 ThanksMister LLC
-->
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx">