Skip to content

Instantly share code, notes, and snippets.

View jonathandreyer's full-sized avatar

Jonathan Dreyer jonathandreyer

View GitHub Profile
@jonathandreyer
jonathandreyer / com.company.launch_beamoff.plist
Last active August 29, 2015 14:26 — forked from rtrouton/com.company.launch_beamoff.plist
LaunchAgent to start BeamOff on login
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.company.launch_beamoff</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/beamoff.app/Contents/MacOS/beamoff</string>
</array>
@jonathandreyer
jonathandreyer / WellerRTProto.ino
Last active August 29, 2015 14:27 — forked from ynsta/WellerRTProto.ino
Weller RT Station PID Protoype
#define TEMPERATURE 350
#define TEMPERATURE_MAX 400
#define PWM_PIN 3
#define PWM_MAX 245
#define PID_INT_MAX (500)
#define PID_INT_MIN (-PID_INT_MAX)
#define TEMP_GAIN 0.42
# -*- coding: utf-8 -*-
import logging
import atexit
import RPi.GPIO as GPIO
class A4988Driver:
STEP = 18 # PWM0
DIRECTION = 17
MS1 = 15
@jonathandreyer
jonathandreyer / mainflux_example_thing_configuration&bootstrap.py
Last active February 25, 2020 20:15
Script to setup environment with user, thing & channels followed by the configuration of a one device for bootstrapping
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Bash command used to launch mainflux architecture with bootstrap service:
# $ docker-compose -f docker/docker-compose.yml -f docker/aedes.yml up
# $ docker-compose -f docker/addons/bootstrap/docker-compose.yml up
import requests
import json
@jonathandreyer
jonathandreyer / docker-compose.sh
Created May 3, 2020 07:56
Script to manage multi-container Docker with more than one docker-compose file (up/ps/logs/pull/down/clean/restart)
#!/bin/bash
#===================================================================================
# FILE: docker-compose.sh
#
# USAGE: docker-compose [up] [ps] [logs {-f}] [pull] [down] [clean {-a}] [restart {-c}]
#
# DESCRIPTION: Launch instance of mainflux with docker-compose.
#
# OPTIONS: see function ’usage’ below
@jonathandreyer
jonathandreyer / flask_catch-all-routes.py
Created May 3, 2020 08:42
Catch all routes and data with flask
#!/usr/bin/python
# -*- coding: utf-8 -*-
from flask import Flask, request
import json
import logging
app = Flask(__name__)
@jonathandreyer
jonathandreyer / EM4302.js
Last active May 7, 2023 21:02
New device (Schneider Electric EM4302) for Zigbee2MQTT
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const utils = require('zigbee-herdsman-converters/lib/utils');
const e = exposes.presets;
const ea = exposes.access;
/*const attributes_basic = ["schneiderMeterRadioPower"];