Skip to content

Instantly share code, notes, and snippets.

@cdrum
cdrum / keybase.md
Created May 31, 2023 01:36
Keybase Proof

Keybase proof

I hereby claim:

  • I am cdrum on github.
  • I am cdrum (https://keybase.io/cdrum) on keybase.
  • I have a public key ASARlLcw2fimWQWQ5LobXO6DNfPbtlPD-0aj4V61brnMuwo

To claim this, I am signing this object:

0x4fA61b525CBAFdb29619697B68b46436256E5408
/*********************************************************************
The LAZY GARDENER!
My simple soil moisture detection and pump activation utility.
Copyright (c) Chris Drumgoole 2016
http://www.cdrum.com
https://github.com/cdrum/lazy-gardener
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@cdrum
cdrum / lifx-check.php
Last active August 29, 2015 14:08
Simple script to check status of lifx bulbs using ruby http api, and display count and last check time
?php
$now = date("r");
// Change these settings to match your environment
const RESTAPI_URL = "http://192.168.1.221:56780";
$result = json_decode(file_get_contents(RESTAPI_URL . "/lights.json"));
@cdrum
cdrum / Example output
Created October 26, 2014 14:21
example code
local http = require('socket.http')
http.TIMEOUT = 20
http.request{url='http://192.168.1.221:56780/lights/d073d5005654/on', method='PUT', headers = {['Content-Length'] = string.len(''),['Content-Type'] = 'application/x-www-form-urlencoded'}}
http.request{url='http://192.168.1.221:56780/lights/d073d5005654/color?hue=0&saturation=0&brightness=0.35138475623713&kelvin=2500', method='PUT', headers = {['Content-Length'] = string.len(''),['Content-Type'] = 'application/x-www-form-urlencoded'}}
http.request{url='http://192.168.1.221:56780/lights/d073d500114b/on', method='PUT', headers = {['Content-Length'] = string.len(''),['Content-Type'] = 'application/x-www-form-urlencoded'}}
http.request{url='http://192.168.1.221:56780/lights/d073d500114b/color?hue=0&saturation=0&brightness=0.28865491721981&kelvin=2500', method='PUT', headers = {['Content-Length'] = string.len(''),['Content-Type'] = 'application/x-www-form-urlencoded'}}
http.request{url='http://192.168.1.221:56780/lights/d073d5008af8/on', method='PUT', headers =