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/
$ 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 / 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
@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 / auto_star_openstack_repos.py
Last active May 25, 2016 13:34 — forked from jd/auto-star-openstack-repo
Starring all OpenStack Git repositories
#!/usr/bin/env python
from github import Github
import os
TOKEN = os.environ.get("GITHUB_TOKEN")
USERS = ("openstack", "stackforge", "openstack-dev", "openstack-infra", "openstack-attic", "stackforge-attic", "hackebrot")
g = Github(TOKEN)
me = g.get_user()