Skip to content

Instantly share code, notes, and snippets.

View RandomArray's full-sized avatar

Mike Johanning RandomArray

View GitHub Profile
@RandomArray
RandomArray / disable-mouse-scroll-zoom-sublime-text.ahk
Created July 10, 2021 02:29
Disable scroll wheel text zoom in Sublime Text 4 - AutoHotKey Script
SendMode Input
#IfWinActive, ahk_exe sublime_text.exe
^WheelDown::return
^WheelUp::return
@RandomArray
RandomArray / automations.yaml
Created December 25, 2021 10:42
Home Assistant automation to randomly cycle through all WLED effects on a set interval
# Modified from examples found here: https://community.home-assistant.io/t/wled-script-to-alternate-between-effects-every-5-minutes/227553/39
# List of all effects: https://github.com/Aircoookie/WLED/wiki/List-of-effects-and-palettes
alias: WLED Cycle Random Effects
description: Sets WLED to random effect from list on interval while WLED remains on.
trigger:
- platform: device
type: turned_on
device_id: 94b3087d775f6f1a48286fc1e0230d6a # update to match device_id
entity_id: light.wled # update to match entity_id
domain: light
@RandomArray
RandomArray / checktemp.sh
Last active January 7, 2022 06:38 — forked from uGeek/INSTALL.md
Log Raspberry Pi temperature to text file
#!/bin/bash
cpuTemp0=$(cat /sys/class/thermal/thermal_zone0/temp)
cpuTemp1=$(($cpuTemp0/1000))
cpuTemp2=$(($cpuTemp0/100))
cpuTempM=$(($cpuTemp2 % $cpuTemp1))
#RPi4 has a different path to vcgencmd on bullseye
gpuTemp=$(/opt/vc/bin/vcgencmd measure_temp 2>/dev/null || /usr/bin/vcgencmd measure_temp 2>/dev/null)
# Function to write the temperature into the log
function writeToLog() {
@RandomArray
RandomArray / random-bs.php
Last active April 26, 2022 01:09
Freezes up Chrome / Android - Works as intended on Chrome / PC
<!DOCTYPE html>
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!--><html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>RANDOM BS</title>
<meta name="description" content="RANDOM BS">
<meta name="author" content="Mike Johanning">
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar
template:
- sensor:
- name: "Painting Weather Conditions"
state: >
{% set temp = states('sensor.lacrosse_tx141thbv2_0_144_t')|float %}
{% set humid = states('sensor.lacrosse_tx141thbv2_0_144_h')|float %}
{% if is_number(temp) and is_number(humid) and temp | float > 50 and temp | float < 90 and humid | float < 65 %}
Yes
{% elif temp | float <= 50 or temp | float >= 90 or humid | float >= 65 %}
No
@RandomArray
RandomArray / painting-weather-conditions-template.jinja2
Last active January 18, 2023 08:42
Home Assistant - Script - Google Assistant TTS Speak Weather Conditions
{% set temp = states("sensor.lacrosse_tx141thbv2_0_144_t")|float|round
%}
{% set humid = states("sensor.lacrosse_tx141thbv2_0_144_h")|float|round
%}
{% if temp >=50 and temp <= 90 and humid <= 65 and (50 - temp)|abs <= 10
and (temp - 90) <= 10 or temp >=50 and temp <= 90 and humid <= 65 and
(65 - humid)|abs <= 10 %}