Skip to content

Instantly share code, notes, and snippets.

View mrdoornbos's full-sized avatar

Michael Doornbos mrdoornbos

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mrdoornbos on github.
  • I am mrdoornbos (https://keybase.io/mrdoornbos) on keybase.
  • I have a public key ASBIZdabJTZ_aJSWqJ_DdZCwCOohPdtgy1pGkb6mT7x8qAo

To claim this, I am signing this object:

age = 18.00 * 365.25
if age > 10000:
print("Wow you made it to 10,000. You are at %s" % age)
else:
age = 10000 - age
print("You only have this many days to go: %s" % age)
@mrdoornbos
mrdoornbos / mqtt_export.py
Created June 2, 2017 10:52 — forked from darookee/mqtt_export.py
Export Home Assistant state changes to MQTT
"""
MQTT publisher for all Home Assistant states.
Copyright (c) 2016 Fabian Affolter <[email protected]>
Licensed under MIT
For questions and issues please use https://community.home-assistant.io
To use this component you will need to add something like the
following to your configuration.yaml file.
@mrdoornbos
mrdoornbos / update_accounts_sql.sql
Created May 1, 2017 11:16
Update SH Database accounts to fix timezones
select * from Locations where Account = '73300'
update Locations set timezone = 'Alaska' where Account = '73300'
select * from Locations where Account = '73300'
select * from Locations where Account = '73230'
update Locations set timezone = 'Hawaii' where Account = '73230'
select * from Locations where Account = '73230'
@mrdoornbos
mrdoornbos / xplane.py
Created January 12, 2017 13:57 — forked from timtrueman/xplane.py
This is just meant as an example to get you started. You will need to install Twisted ("sudo easy_install twisted").
#!/usr/bin/env python
# encoding: utf-8
import socket
from struct import *
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
import math
UDP_IP="127.0.0.1"
init_config:
# the check will refresh the matching pid list every X seconds
# except if it detects a change before. You might want to set it
# low if you want to alert on process service checks.
# pid_cache_duration: 120
instances:
- name: ssh
search_string: ['ssh', 'sshd']
var Helper = {
getDeviceImageByStatus: function(status) {
switch (status) {
case "open":
// door_open
return Appery.getImagePath("door_open") + ".png";
case "closed":
//door_closed
@mrdoornbos
mrdoornbos / gist:7570045
Created November 20, 2013 20:03
git aliases
alias gst='git status'
alias gl='git pull origin master'
alias gp='git push origin master'
alias gd='git diff | mate'
alias gc='git commit -v'
alias gca='git commit -v -a'
alias gb='git branch'
alias gba='git branch -a'
hdiutil attach -nomount -noverify -noautofsck -stdinpass -debug MyImage.sparseimage
#Ignore the Mac OS X .DS_Store files
.DS_Store
#Ignore user-specific settings
*.mode1v3
*.mode2v3
*.pbxuser
*.perspectivev3
#Ignore textmate build errors