Skip to content

Instantly share code, notes, and snippets.

View d0ugal's full-sized avatar
👋
Hi!

Dougal Matthews d0ugal

👋
Hi!
View GitHub Profile
@d0ugal
d0ugal / date_file_to_exif.py
Created August 13, 2023 19:58
Adds the date info to a file based on the file name
from datetime import datetime
import piexif #piexif==1.1.3
import os
import sys
dir = sys.argv[1]
for file in os.listdir(dir):
if file.endswith('.png'):
continue
sensor:
- platform: template
sensors:
study_active_scene:
entity_id:
- binary_sensor.in_game
- binary_sensor.study_lights_on
- binary_sensor.study_sockets_on
- input_boolean.study_alert
- input_boolean.study_front_door_motion
sensor:
- platform: template
sensors:
ring_video_url:
friendly_name: "Ring Video URL"
value_template: >-
{%- if states.camera.front_door.attributes.video_url != None -%}
{{states.camera.front_door.attributes.video_url.split('?')[0]}}
{%- else -%}
unknown
@d0ugal
d0ugal / references.txt
Last active March 25, 2017 13:07
Effective Code Review References
Code Complete by Steve McConnell
Jeff Atwood (Coding Horror)
https://blog.codinghorror.com/code-reviews-just-do-it/
Measuring Defect Potentials and Defect Removal Efficiency
http://rbcs-us.com/site/assets/files/1337/measuring-defect-potentials-and-defect-removal-efficiency.pdf
Expectations, Outcomes, and Challenges Of Modern Code Review
https://www.microsoft.com/en-us/research/publication/expectations-outcomes-and-challenges-of-modern-code-review/
@d0ugal
d0ugal / crawler.yaml
Created November 15, 2016 16:57
Broken Mistral Crawler
# Before starting this, you need to create the mistral-environment.
# $ cat ~/env.json
# {"name": "crawler", "variables": {"visited": []}}
# mistral environment-create env.json
---
version: '2.0'
name: crawler
description: Web Scraping Workbook
$ vulture mkdocs --exclude mkdocs/tests/
mkdocs/__main__.py:20: Unused attribute 'disable_unicode_literals_warning'
mkdocs/__main__.py:28: Unused attribute 'propagate'
mkdocs/__main__.py:37: Unused variable 'pass_state'
mkdocs/__main__.py:41: Unused variable 'param'
mkdocs/__main__.py:101: Unused function 'serve_command'
mkdocs/__main__.py:134: Unused function 'build_command'
mkdocs/__main__.py:162: Unused function 'json_command'
mkdocs/__main__.py:196: Unused function 'gh_deploy_command'
mkdocs/__main__.py:219: Unused function 'new_command'
$ vulture mkdocs --exclude mkdocs/tests/
mkdocs/__main__.py:20: Unused attribute 'disable_unicode_literals_warning'
mkdocs/__main__.py:28: Unused attribute 'propagate'
mkdocs/__main__.py:37: Unused variable 'pass_state'
mkdocs/__main__.py:41: Unused variable 'param'
mkdocs/__main__.py:101: Unused function 'serve_command'
mkdocs/__main__.py:134: Unused function 'build_command'
mkdocs/__main__.py:162: Unused function 'json_command'
mkdocs/__main__.py:196: Unused function 'gh_deploy_command'
mkdocs/__main__.py:219: Unused function 'new_command'
@d0ugal
d0ugal / my-gerrit-dash.ini
Created July 14, 2016 08:52
Gerrit Dash Config
[dashboard]
title = My Reviews
description = My Reviews
foreach =
[section "Negative Review"]
query = owner:self is:open label:Code-Review<=-1
[section "Failed CI"]
query = owner:self is:open label:Verified<=-1 NOT label:Workflow<=-1
#!/bin/bash
SCREEN_DIR=~/Dropbox/Public/Screenshots
SCREEN_PROMPT=1
window='root'
case $1 in
root)
window='root';;
@d0ugal
d0ugal / 0-user-setup.sh
Last active June 13, 2016 07:56
TripleO
#!/bin/bash -xe
sudo yum upgrade -y
sudo yum install -y tmux vim wget
sudo useradd stack
echo "stack ALL=(root) NOPASSWD:ALL" | sudo tee -a /etc/sudoers.d/stack
sudo chmod 0440 /etc/sudoers.d/stack
su - stack