Skip to content

Instantly share code, notes, and snippets.

View houstonhaynes's full-sized avatar

Houston Haynes houstonhaynes

View GitHub Profile
@houstonhaynes
houstonhaynes / DoughnutView.axaml
Last active December 13, 2023 18:45
ViewModel that uses a recursive update function to "reach" multiple model elements from a single data set change
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="1200" d:DesignHeight="850"
xmlns:lvc="using:LiveChartsCore.SkiaSharpView.Avalonia"
xmlns:vm="using:AvaloniaExample.ViewModels"
xmlns:avalonia="clr-namespace:LiveChartsCore.SkiaSharpView.Avalonia;assembly=LiveChartsCore.SkiaSharpView.Avalonia"
Design.DataContext="{Binding Source={x:Static vm:DoughnutViewModel.DesignVM}}"
x:DataType="vm:DoughnutViewModel"
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@houstonhaynes
houstonhaynes / GetTimeAtSolarAzimuth.fsx
Last active September 25, 2023 11:41
Sundial function to calculate time based on azimuth position of the Sun
#r "nuget: CoordinateSharp"
open System
open CoordinateSharp
let find_Closest_TimeUnit addTimeFn rangeStart rangeEnd (c : Coordinate) azimuth adjustNegatively =
let el = EagerLoad(EagerLoadType.Celestial)
el.Extensions <- EagerLoad_Extensions(EagerLoad_ExtensionsType.Solar_Cycle)
@houstonhaynes
houstonhaynes / ConfigFileModule.fs
Last active August 3, 2023 20:31
Basic Meadow Config File module for both WiFi and Config settings
module ConfigFileModule
type Device = {
Name: string
}
type Coprocessor = {
AutomaticallyStartNetwork: bool
AutomaticallyReconnect: bool
MaximumRetryCount: int
@houstonhaynes
houstonhaynes / BluethoothModule.fs
Created July 28, 2023 18:16
Plugin.BLE functions to use in cross platform Bluetooth Client apps
module BluetoothModule
open System
open Plugin.BLE
open Plugin.BLE.Abstractions.Contracts
open Plugin.BLE.Abstractions.EventArgs
type BLEConnectionResult =
| Success of unit
| Failure of string
@houstonhaynes
houstonhaynes / scratch.fsx
Created July 20, 2023 20:10
Solar tracker hack for Asheville, NC from July-19 to Oct-18 2023
#r "nuget: CoordinateSharp"
open System
open CoordinateSharp
let calculateSolarNoon latitude longitude (date: DateTime) =
let celestialTimes = Celestial.CalculateCelestialTimes(latitude, longitude, date, 0.0)
celestialTimes.SolarNoon.Value.ToLocalTime()
// Helper function to convert degrees to radians
@houstonhaynes
houstonhaynes / AzureFunctionSecret.fs
Created June 13, 2023 14:29 — forked from ninjarobot/AzureFunctionSecret.fs
Example of retrieving a secret from an F# Azure Function App
namespace AzurefnSecret
open Microsoft.Azure.KeyVault
open Microsoft.IdentityModel.Clients.ActiveDirectory
module Example =
let getSecret (appKeyDescription:string) (appKeyValue:string) (secretUrl:string) =
async {
use keyVault = new KeyVaultClient(fun authority resource (_:string) ->
async {
@houstonhaynes
houstonhaynes / FSSF_meeting_notes_20220210.md
Last active February 10, 2022 20:08
Feb 10 meeting notes

FSSF Meeting Minutes, 2022/02/10 (February 10th, 2022)

This regular meeting of the F# Software Foundation Board was held over Slack (text chat) on February 10th, 2022, beginning at 4:00 PM UTC, ending at 5:00 PM UTC.

Votes are reported in the form “Y-N-A” (in favor-Y, opposed-N, abstentions-A; e.g. “5-1-2” means “5 in favor, 1 opposed, and 2 abstentions”).

Redactions may be used to protect information that has business sensitivity (e.g., negotiating positions), when a third party’s name is used without the third party’s knowledge (e.g., discussion of candidates for a volunteer position or award), or to protect the subject of personnel discussions.

Attendance

@houstonhaynes
houstonhaynes / FSSF_meeting_notes_20220113.md
Last active January 14, 2022 23:39
FSSF_meeting_notes_20220113.md

FSSF Meeting Minutes, 2022/01/13 (January 13th, 2022)

This regular meeting of the F# Software Foundation Board was held over Slack (text chat) on January 13th, 2022, beginning at 4:00 PM UTC, ending at 5:00 PM UTC.

Votes are reported in the form “Y-N-A” (in favor-Y, opposed-N, abstentions-A; e.g. “5-1-2” means “5 in favor, 1 opposed, and 2 abstentions”).

Redactions may be used to protect information that has business sensitivity (e.g., negotiating positions), when a third party’s name is used without the third party’s knowledge (e.g., discussion of candidates for a volunteer position or award), or to protect the subject of personnel discussions.

Attendance

FSSF Meeting Minutes, 2021/10/21 (October 21st, 2021)

This regular meeting of the F# Software Foundation Board was held over Slack on October 21st, 2021, beginning at 4:13 PM UTC with full quorum, ending at 5:02 PM UTC.

Votes are reported in the form “Y-N-A” (in favor-Y, opposed-N, abstentions-A; e.g. “5-1-2” means “5 in favor, 1 opposed, and 2 abstentions”).

Redactions may be used to protect information that has business sensitivity (e.g., negotiating positions), when a third party’s name is used without the third party’s knowledge (e.g., discussion of candidates for a volunteer position or award), or to protect the subject of personnel discussions.

Attendance