Skip to content

Instantly share code, notes, and snippets.

View jetpacktuxedo's full-sized avatar

Ethan Madden jetpacktuxedo

View GitHub Profile
@jetpacktuxedo
jetpacktuxedo / copy_light.yaml
Created April 22, 2024 16:15
HomeAssistant script to copy light brightness and color from one light to another
alias: Copy Light
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ state_attr(source, \"color_mode\") == \"color_temp\"}}"
sequence:
- service: light.turn_on
data_template:
entity_id: "{{ destination }}"
#################################################################
# #
# nmr-data_compilation.py #
# #
# Copyright Patrick H. Willoughby August 2013 #
# #
# Does Bolzmann-analysis and searches for imaginary #
# frequencies, and compiles the NMR shielding tensors #
# then prints the data into several .csv files for #
# viewing in a spreadsheet application #
@jetpacktuxedo
jetpacktuxedo / board%
Created February 8, 2017 04:05
True percentage calculations for a variety of keyboards
Layout width height "area" percentage key count percentage of keys
Full size: 22.5u x 6.5u 146.25 100% 104 100%
TKL: 18.25u x 6.5u 118.625 81.1111% 87 83.65%
75%: 16u x 6u 96 65.64% 84 80.77%
660: 16.5u x 5u 82.5 56.41% 66 63.46%
65%: 16u x 5u 80 54.7% 68 65.38%
60%: 15u x 5u 75 51.28% 60 57.69%
JD40: 12u x 4u 48 32.82% 40 38.46%
Planck: 12u x 4u 48 32.82% 48 46.15%
minivan: 12.75u x 4u 51 34.87% 45 43.27%
from datetime import datetime
import timeit
def loop():
i_counter = 0
# List from 0 to 31999, saved beforehand to not use the generator version of range
# Also reduces the overhead of generating the list twice, which other languages don't have to do
bigrange = list(range(32000))
# No need to save an index variable we never use