Skip to content

Instantly share code, notes, and snippets.

View mgottholsen's full-sized avatar
🎯
Focusing

Matthew Gotth-Olsen mgottholsen

🎯
Focusing
View GitHub Profile
@mgottholsen
mgottholsen / esphome_get_camera_image.py
Created June 1, 2021 19:50 — forked from micw/esphome_get_camera_image.py
Getting camera images from esp32cam with esphome and python
#!/usr/bin/env python3
import aioesphomeapi
import asyncio
async def main():
loop = asyncio.get_running_loop()
cli = aioesphomeapi.APIClient(loop, "HOST-OR-IP", 6053, "API-PASSWORD-OR_EMPTY")
await cli.connect(login=True)
@mgottholsen
mgottholsen / electric_objects.py
Created May 24, 2018 00:03 — forked from harperreed/electric_objects.py
Electric objects simple API wrapper
import requests
import urllib
import requests
import json
import random
"""
here is a wrapper for the *unreleased* electric objects API
Built by Harper Reed (harper@nata2.org) - @harper
@mgottholsen
mgottholsen / README.md
Created August 11, 2017 12:26 — forked from jsanz/README.md
Analysis example: Voronoi on CartoDB

This example loads a CartoDB layer using a crazy SQL from a small variation of this awesome Stack Overflow response. Note the use of CSS style tags for the CartoCSS to allow easy editing.

The uncompressed (and not perfect!) version of the SQL to draw the Voronoi diagram is:

WITH 
    Sample AS (
      SELECT st_setsrid(st_union(the_geom),0) as geom 
      FROM registro_centros_nz WHERE spanish = 1
    ),
@mgottholsen
mgottholsen / make_table.py
Created July 14, 2017 18:23 — forked from btbytes/make_table.py
Given a CSV file with a header row, and at-least one row of data, output a SQL `CREATE TABLE` statement by guessing the data type of the columns.
#!/usr/bin/env python
# encoding: utf-8
"""
make_table.py
Given a CSV file with a header row, and at-least one row of data,
output a SQL `CREATE TABLE` statement by guessing the data type of the columns.
Pradeep Gowda <pradeep@btbytes.com>
License: Public Domain