Skip to content

Instantly share code, notes, and snippets.

base = from(bucket: "stocks")
|> range(start: _start)
|> filter(fn: (r) => r._measurement == "stock" and r.symbol == _symbol)
get = (field, fn) =>
base
|> filter(fn: (r) => r._field == field)
|> aggregateWindow(every: _every, fn: fn, createEmpty: true)
union(tables: [
@castis
castis / bluetoothctl.py
Last active April 11, 2023 00:00 — forked from egorf/bluetoothctl.py
Bluetoothctl wrapper in Python
# Based on ReachView code from Egor Fedorov (egor.fedorov@emlid.com)
# Updated for Python 3.6.8 on a Raspberry Pi
import time
import pexpect
import subprocess
import sys
import logging
@castis
castis / MPL3115A2.py
Created February 13, 2018 14:14 — forked from pepijndevos/MPL3115A2.py
A Python lib for reading the MPL3115A2 over the Raspberry Pi I2C bus.
from smbus import SMBus
from sys import exit
#I2C ADDRESS/BITS
MPL3115A2_ADDRESS = (0x60)
#REGISTERS
MPL3115A2_REGISTER_STATUS = (0x00)