Skip to content

Instantly share code, notes, and snippets.

View anderl80's full-sized avatar
🐝
Busy Bee

Andreas Hopfgartner anderl80

🐝
Busy Bee
View GitHub Profile
@anderl80
anderl80 / .env
Last active June 21, 2023 06:17
LangChain + OpenAI + Azure SQL
OPENAI_API_KEY=
OPENAI_API_BASE=
DATABASE_USERNAME=
DATABASE_PASSWORD=
DATABASE_SERVER=
DATABASE_DB=
@anderl80
anderl80 / merge_pdf_as_duplex_scan.py
Last active December 7, 2021 18:06
Merge separate scans of front and back pages to full duplex scan document.
# https://stackoverflow.com/questions/3444645/merge-pdf-files
import argparse
import warnings
from PyPDF2 import PdfFileWriter, PdfFileReader
parser = argparse.ArgumentParser()
parser.add_argument(dest='front', help="Scan containing front pages.")
parser.add_argument(dest='back', help="Scan containing back pages.")
parser.add_argument(dest='output', help="Output file.")
@anderl80
anderl80 / main.cpp
Created November 2, 2021 21:10
DHT22 MQTT ESP8266
#include <Adafruit_Sensor.h>
// DHT Temperature & Humidity Sensor
// Unified Sensor Library Example
// Written by Tony DiCola for Adafruit Industries
// Released under an MIT license.
// REQUIRES the following Arduino libraries:
// - DHT Sensor Library: https://github.com/adafruit/DHT-sensor-library
// - Adafruit Unified Sensor Lib: https://github.com/adafruit/Adafruit_Sensor
@anderl80
anderl80 / databricks-pipeline-test.py
Created August 10, 2021 08:46
Medium Blog post: Pythonic data (pipeline) testing on Azure
# Databricks notebook source
# MAGIC %md
# MAGIC
# MAGIC - https://youtu.be/pq5CBea12v4
# MAGIC - https://docs.greatexpectations.io/en/latest/guides/how_to_guides/configuring_data_contexts/how_to_instantiate_a_data_context_on_a_databricks_spark_cluster.html
# MAGIC - https://docs.greatexpectations.io/en/latest/guides/how_to_guides/configuring_data_contexts/how_to_instantiate_a_data_context_without_a_yml_file.html
# MAGIC - https://gitpython.readthedocs.io/en/stable/
# COMMAND ----------
@anderl80
anderl80 / smartmeter.cpp
Last active June 7, 2023 16:48
Measure energy uptake from a smart meter with S0 interface (nodemcu12E with IR)
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char *SSID = "";
const char *PSK = "";
const char *MQTT_BROKER = "";
const char *INFLUXDB_USERNAME = "";
const char *INFLUXDB_PASSWORD = "";
@anderl80
anderl80 / Bokeh_server_on_CloudFoundry.md
Last active September 16, 2020 06:31
How to setup a Bokeh server in a Cloud Foundry environment
  • Execute cf push in directory where manifest.yml is
  • Of course you can use pip install with the buildpack, then you need a requiremens.txt instead of environment.yml see cf python buildpack docs