Skip to content

Instantly share code, notes, and snippets.

View cdchris12's full-sized avatar
🤠

Chris Davis cdchris12

🤠
View GitHub Profile
@cdchris12
cdchris12 / light-state-sync.yaml
Last active May 20, 2024 11:00 — forked from fireboy1919/light-state-sync.yaml
Synchronize States Between Two Lights
blueprint:
name: Synchronize brightness states
description: Synchronize the on/off state of 2 entities
domain: automation
input:
entity_1:
name: First entity
selector:
entity: {}
entity_2:
table = (1,2,3,4,5,6,7,8,9,10)
user_input = 1
while 0 < user_input < 11:
user_input = int(input('Enter a number between 1 and 10: '))
if not 0 < user_input < 11:
# Number out of bounds, exit
exit(1)
# End if
#!/usr/env/bin python3
# I don't remember how to do input since it's been so long
# so let's just assume you figure that out and call the input "input_number"
def check_bounds(number):
if number >= 20 and number <= 99:
return True
else:
return False
@cdchris12
cdchris12 / gravityview-trigger-gform_after_submission-form-12.php
Last active March 5, 2019 18:36 — forked from zackkatz/gravityview-trigger-gform_after_submission-form-12.php
GravityView - Trigger the `gform_after_submission` action when an entry is edited, but ONLY for Form #20.
<?php
/**
* GravityView doesn't trigger the `gform_after_submission` action when editing entries. This does that,
* but ONLY FOR FORM #20.
*
* @param array $form
* @param int $entry_id ID of the entry being updated
* @param GravityView_Edit_Entry_Render $object
*

Keybase proof

I hereby claim:

  • I am cdchris12 on github.
  • I am cdchris12 (https://keybase.io/cdchris12) on keybase.
  • I have a public key ASC-9FKS3LJJOMOHHOoWrZ0hTK3zvhzVFjGM56ToOPwJhwo

To claim this, I am signing this object:

@cdchris12
cdchris12 / notify_added_lastweek.py
Last active February 21, 2017 17:41 — forked from blacktwin/notify_added_lastweek.py
Send an email with what was added to Plex in the past week using PlexPy.
#!/usr/bin/python
"""
Send an email with what was added to Plex in the past week using PlexPy.
Email includes title (TV: Show Name: Episode Name; Movie: Movie Title), time added, image, and summary.
"""
import requests
import sys
import time
import os
@cdchris12
cdchris12 / go.py
Last active May 23, 2016 17:18 — forked from raylu/Makefile
Go question
#!/usr/bin/env python
# Go is a 2 player board game with simple rules. Two players alternate turns
# placing stones on a grid. If a stone is surrounded on 4 sides by stones of
# the opponent, it is captured. If a group of stones are surrounded, they are
# captured.
# See http://en.wikipedia.org/wiki/Rules_of_Go#Capture for a visual explanation.
# Below is an implementation of a Go board. Please write some code in the
# move() method to check for captures and output something when a capture