Skip to content

Instantly share code, notes, and snippets.

View houstonhaynes's full-sized avatar

Houston Haynes houstonhaynes

View GitHub Profile
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"console_title_template": "{{ if .Root }}root @ {{.HostName}} {{ end }}{{ .Shell }} in {{ .Folder }}",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#575656",
"foreground": "#D6DEEB",
@houstonhaynes
houstonhaynes / ZoomView.axaml
Created January 1, 2024 23:12
Scrollbar Chart Setup
<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"
xmlns:ic="using:FluentIcons.Avalonia"
mc:Ignorable="d" d:DesignWidth="1400" d:DesignHeight="800"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.Avalonia;assembly=LiveChartsCore.SkiaSharpView.Avalonia"
xmlns:vm="using:AidenDesktop.ViewModels"
Design.DataContext="{Binding Source={x:Static vm:ChartViewModel.DesignVM}}"
x:DataType="vm:ZoomViewModel"
@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

.NET OSS Documentation tools

Houston's Note

My goal is to find a way to adapt/co-opt Hugo templates into an .NET driven static site generator.

Right now the two main candidates are Statiq and Fornax

Criteria

@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 {