Skip to content

Instantly share code, notes, and snippets.

@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 %}
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
# 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
@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">
@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 / 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 / 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 / urbackup-notes.txt
Created November 26, 2016 01:06
Installing UrBackup Client with and setting up common folders to backup
TF=`mktemp` && wget "https://hndl.urbackup.org/Client/2.0.36/UrBackup%20Client%20Linux%202.0.36.sh" -O $TF && sh $TF; rm $TF
urbackupclientctl add-backupdir -x -f -d /home
urbackupclientctl add-backupdir -x -f -d /root
urbackupclientctl add-backupdir -x -f -d /etc
urbackupclientctl add-backupdir -x -f -d /var

Web Design Contract

Based on Contract Killer, an open-source contract for web developers.

Summary:

I’ll always do my best to fulfill your needs and meet your expectations, but it’s important to have things written down so that we both know what’s what, who should do what and when, and what will happen if something goes wrong. In this contract you won’t find any complicated legal terms or long passages of unreadable text. I have no desire to trick you into signing something that you might later regret. What I do want is what’s best for both parties, now and in the future.

So in short;

You ([CLIENT COMPANY]), located at [CLIENT ADDRESS] are hiring me ([DEVELOPER]) located at [DEVELOPER ADDRESS] to design and develop a web site for the estimated total price of [QUOTE] as outlined in our previous correspondence.

@RandomArray
RandomArray / ucm-archive-bookmarklet.js
Created November 9, 2016 18:40
Bookmarklet javascript for Ultimate Client Manager. It triggers a click event on all "Archive" buttons. Avoid clicking every button individually as there is not an "Archive All" button in UCM.
////////////////
//
// Equivalent to running the following jQuery in the console.
//
// $('.socialtwitter_message_action').click();
//
////////////////
javascript:(function()%7B%24('.socialtwitter_message_action').click()%7D)()