Skip to content

Instantly share code, notes, and snippets.

Welcome to the Berry Scripting console. Check the documentation.

tasmota.read_sensors()
{"Time":"2024-02-11T23:49:43","SHTC3":{"Temperature":12.1,"Humidity":19.8,"DewPoint":-10.3},"VL53L0X":{"Distance":null},"ESP32":{"Temperature":13.4},"TempUnit":"C"}
SHTC3#Temperature
BRY: Exception> 'syntax_error' - input:1: 'SHTC3' undeclared (first use in this function)
"SHTC3#Temperature"
SHTC3#Temperature
tasmota.read_sensors("SHTC3")
@papakpmartin
papakpmartin / README.md
Last active June 12, 2018 04:16
Merging shapefiles and making GEOJSON

After downloading the Natural Earth country and state/province shapefiles, unzip them into a directory and then cd into that directory. Then merge the shapefiles into one file called merged.shp by doing...

docker run -v $(pwd):/data geodata/gdal \
ogr2ogr \
  -lco ENCODING=UTF-8 \
  -f "ESRI Shapefile" \
  merged.shp \
  ne_50m_admin_0_countries/ne_50m_admin_0_countries.shp
// This #include statement was automatically added by the Particle IDE.
#include "OneWire/OneWire.h"
#include "spark-dallas-temperature/spark-dallas-temperature.h"
double tempF = 0.0;
int tempSensorPin = D2;
OneWire oneWire(tempSensorPin);
DallasTemperature sensors(&oneWire);

Keybase proof

I hereby claim:

  • I am papakpmartin on github.
  • I am papakpmartin (https://keybase.io/papakpmartin) on keybase.
  • I have a public key whose fingerprint is 5838 A736 F1E8 D402 CA14 1F91 D0D1 6D2B 8F96 327E

To claim this, I am signing this object:

@papakpmartin
papakpmartin / defaultify.js
Last active December 12, 2015 12:39
My defaultify function using defaultValue and not a data- attribute
/**
* defaultify gets any INPUTs classed with .defaultify and causes them to "empty" onFocus and
* repopulate the default onBlur. This uses the HTML4 built-in `defaultValue` property (see
* https://developer.mozilla.org/en-US/docs/DOM/HTMLInputElement
*
* @returns nothing
* @requires jQuery
* @author KPM
*/
defaultify: function() {