Skip to content

Instantly share code, notes, and snippets.

View steveheinsch's full-sized avatar

Cronix steveheinsch

View GitHub Profile
@steveheinsch
steveheinsch / EncoderDemo.ino
Last active January 28, 2020 06:29
Rotary Encoder demo for FastLED. Fading up/down on power on/off + fading up/down on encoder change
/*
Demo to show fading in/out brightness for LED's using a Rotary Encoder.
Code has comments for where FastLED commands would be. FastLED is not
needed for this. You can just open the serial monitor and watch things change
for this DEMO. This Demo is using an ESP32, and using a specific Encoder library
for it.
1. Press ON - fades from 0 up to powerOnBrightness (120)
2. Press Off - Fades from current brightness to 0
3. Turn Knob Right - Increase brightness by encoderSteps (20) and fade up to it
/**
* Helper to translate "RETS" field definitions to mysql datatypes and eloquent methods
* @param $retsFieldDefinition
*
* @return object
*/
public function translateRetsField($retsFieldDefinition)
{
$retsInterpretation = $retsFieldDefinition->Interpretation;
$retsDataType = $retsFieldDefinition->DataType;
@steveheinsch
steveheinsch / gist:287edd5ce26e608b06b20af384f4cc1e
Last active September 26, 2022 21:53
Function to retrieve all lookup key/values for a Resource/Class in PHRETS 2+
<?php
// Note: $this->server is a "logged in" PHRETS $session
public function getLookupValues($resourceName, $className)
{
$results = array();
// Get Table Metadata for this resource/class
$tableMeta = $this->server->GetTableMetadata($resourceName, $className);