Skip to content

Instantly share code, notes, and snippets.

View brombomb's full-sized avatar
🐙
Coding

Rob Walsh brombomb

🐙
Coding
View GitHub Profile
@ngardiner
ngardiner / TeslaMateMQTT.md
Last active May 21, 2023 21:46
Using TeslaMate MQTT Topics in HomeAssistant

TeslaMate MQTT Integration - HomeAssistant

Introduction

This documents the process of replacing the official HomeAssistant Tesla component with MQTT interactions with TeslaMate.

Benefits

TeslaMate is better at polling the Tesla API, through the use of a better implemented polling mechanism with appropriate back-offs to allow Tesla vehicles to sleep.

It is also extremely useful to have running in parallel with HomeAssistant, offering a logical split between monitoring and visualisation (teslamate) and automation (HomeAssistant). Given HomeAssistant can talk via a common bus to other smart home components such as Garage Doors, Charger systems etc, it would not make sense to re-implement automation externally to HomeAssistant where it can be avoided.

@6174
6174 / Random-string
Created July 23, 2013 13:36
Generate a random string in JavaScript In a short and fast way!
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
@cloudily
cloudily / reload-css.js
Created July 16, 2012 16:04
Reload CSS Bookmarklet
(function(){function c(){a=window.jQuery.noConflict(!0),d()}function d(){a(document).ready(function(b){b("link[rel='stylesheet']").each(function(){var c=b(this),d=c.attr("href");d&&a.trim(c.text())==""&&d.indexOf("data:text/css")!==0&&(d=d.replace(/(\&|\?)\_\=(\d+)/,""),d+=d.indexOf("?")>-1?"&":"?",d+="_="+Date.now(),c.attr("href",d))})})}var a;if(window.jQuery===undefined||window.jQuery.fn.jquery!=="1.7.2"){var b=document.createElement("script");b.setAttribute("type","text/javascript"),b.setAttribute("src","//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"),b.readyState?b.onreadystatechange=function(){(this.readyState=="complete"||this.readyState=="loaded")&&c()}:b.onload=c,(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(b)}else a=window.jQuery,d()})();
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a