Skip to content

Instantly share code, notes, and snippets.

Avatar
👋
Hi!

Dougal Matthews d0ugal

👋
Hi!
View GitHub Profile
View gist:3909cb20343a1a937c23b9c0711a57da
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
View hall.yaml
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 Mar 25, 2017
Effective Code Review References
View references.txt
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/
View exclude-tests.txt
$ 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'
View gist:da7beecec0f01323b2b7d392563bb150
$ 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 Nov 15, 2016
Broken Mistral Crawler
View crawler.yaml
# 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
View my-gerrit-dash.ini
[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
View screenshot.sh
#!/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 — forked from jd/auto-star-openstack-repo
Starring all OpenStack Git repositories
View auto_star_openstack_repos.py
#!/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()
View 0-user-setup.sh
#!/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