Skip to content

Instantly share code, notes, and snippets.

View houstonhaynes's full-sized avatar

Houston Haynes houstonhaynes

View GitHub Profile
@houstonhaynes
houstonhaynes / GHIssueExtractor.fsx
Last active February 14, 2025 13:52
An F# script to extract open GitHub issues from a repo as Markdown
#r "nuget: Octokit"
open Octokit
open System
open System.IO
open System.Text.RegularExpressions
// Configuration
type Config = {
Token: string
RepoUrl: string
@houstonhaynes
houstonhaynes / osm2pgsql_properties.txt
Created January 29, 2025 03:32
Number of OpenStreetMaps / Nominatim properties for the US map
(nominatim-venv) nominatim@map:~$ nominatim import --osm-file nominatim-project/us-latest.osm.pbf --threads 16
2025-01-29 01:34:07: Using project directory: /srv/nominatim
2025-01-29 01:34:08: Creating database
Database dbname=nominatim already exists. Skipping creation.
2025-01-29 01:34:08: Setting up country tables
2025-01-29 01:34:09: Importing OSM data file
2025-01-29 01:34:09 osm2pgsql version 1.11.0
2025-01-29 01:34:09 Database version: 17.2 (Ubuntu 17.2-1.pgdg24.04+1)
2025-01-29 01:34:09 PostGIS version: 3.5
2025-01-29 01:34:09 Storing properties to table '"public"."osm2pgsql_properties"'.
@houstonhaynes
houstonhaynes / GICS_extended.csv
Last active January 2, 2025 14:19
Expanded GICS taxonomy with some custom curated entries for Non-Profit & NGOs plus Public Sector
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 3.
10101010,Oil & Gas Drilling,Drilling contractors or owners of drilling rigs that contract their services for drilling wells.,101010,Energy Equipment & Services,1010,Energy,10,Energy
10101020,Oil & Gas Equipment & Services,"Manufacturers of equipment, including drilling rigs and equipment, and providers of supplies such as fractured silica and services to companies involved in the drilling, evaluation and completion of oil and gas wells. This Sub-Industry includes companies that provide information and data services such as seismic data collection primarily to the oil & gas industry and distributors of oil & gas equipment products. This Sub-Industry excludes oil spill services companies classified in the Environmental & Facilities Services Sub-Industry.",101010,Energy Equipment & Services,1010,Energy,10,Energy
10102010,Integrated Oil & Gas,"Integrated oil companies engaged in the exploration & production of oil and gas, as well as at least one other significant activity in either refining, marketing and transp
@houstonhaynes
houstonhaynes / Update-and-BuildProject.ps1
Last active December 18, 2024 19:17
Sample webhook and build/deploy script for .NET back end server
#!/usr/bin/env pwsh
param (
[Parameter(Mandatory = $true)]
[string]$refBranch
)
function Update-and-BuildProject {
param (
[string]$repoUrl,
@houstonhaynes
houstonhaynes / callAzureOpenAI.fs
Last active October 10, 2024 14:34
Function that calls Azure OpenAI endpoint
let callAzureOpenAI (text: string) =
task {
let apiKey = Environment.GetEnvironmentVariable("AZUREOPENAI_API_KEY")
if String.IsNullOrEmpty(apiKey) then
return! ServerError.failwith (ServerError.Exception "Azure OpenAI API key is not set.")
else
let url = "https://[YOUR_AZURE_SERVICE]/openai/deployments/gpt-35-turbo/chat/completions?api-version=2024-02-15-preview"
use httpClient = new HttpClient()
httpClient.DefaultRequestHeaders.Add("api-key", apiKey)
let requestPayload = {
@houstonhaynes
houstonhaynes / ParseCMS_CSVtoParquet.fs
Created August 2, 2024 00:51
Parse CMS Medicare Part D data into state-based parquet files
open System
open System.IO
open ParquetSharp
open ParquetSharp.Schema
let fileInputPath = "Files/"
let fileOutputPath = "Files/parquet/"
// Define the file dictionary
let fileDict =
@houstonhaynes
houstonhaynes / WeatherReading.fs
Last active July 3, 2024 02:02
Modules for reading from the OpenWeatherMap API (BYOK)
module WeatherReading
open System
type Coordinates =
{
lon: float
lat: float
}
@houstonhaynes
houstonhaynes / git-pull-Meadow.ps1
Last active June 1, 2024 03:12
A script to cycle through each "Meadow." folder and run 'git pull' then output results to a local log file.
# Define the root directory where you want to start the search
$rootDirectory = "D:\repos"
# Create a unique log file with a datetime stamp
$logFileName = "Meadow_pull_log_$(Get-Date -Format 'yyyyMMdd_HHmmss').txt"
$logFilePath = Join-Path -Path $rootDirectory -ChildPath $logFileName
# Get immediate child folders (one level down)
$childFolders = Get-ChildItem -Path $rootDirectory -Directory
{
"$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"