From: Edward Delaporte Date: Tue, 21 Nov 2023 16:11:40 +0000 (-0600) Subject: Merge branches 'main' and 'main' of github.com:edthedev/dotfiles X-Git-Url: https://apps.delaporte.us/gitweb/dotfiles.git/commitdiff_plain/89a871d580aa28e16d00f7820b87f5225f53b2d1?hp=f9ee7d58cc991f882effb2b5b6e8b5a66c49f53d Merge branches 'main' and 'main' of github.com:edthedev/dotfiles --- diff --git a/files/Microsoft.PowerShell_profile.ps1 b/files/Microsoft.PowerShell_profile.ps1 index 583496c..7aeb692 100644 --- a/files/Microsoft.PowerShell_profile.ps1 +++ b/files/Microsoft.PowerShell_profile.ps1 @@ -32,6 +32,7 @@ $env:psmodules = "$env:dotfiles\psmodules" Import-Module "$env:psmodules\dash.psm1" Import-Module $env:PSModules\file_management.psm1 Import-Module "$env:psmodules\fix_vpn.psm1" +Import-Module $env:PSModules\house_shopping.psm1 # Let's face it, I'm about to cd into my source directory if((Get-Location).Path -eq $HOME){ cd $env:src } diff --git a/files/vscodium/product.json b/files/vscodium/product.json new file mode 100644 index 0000000..972a691 --- /dev/null +++ b/files/vscodium/product.json @@ -0,0 +1,8 @@ +{ + "extensionsGallery": { + "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery", + "itemUrl": "https://marketplace.visualstudio.com/items", + "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index", + "controlUrl": "" + } + } \ No newline at end of file diff --git a/files/windows/detail_view.reg b/files/windows/detail_view.reg new file mode 100644 index 0000000..832996a --- /dev/null +++ b/files/windows/detail_view.reg @@ -0,0 +1,139 @@ +Windows Registry Editor Version 5.00 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{0b0ba2e3-405f-415e-a6ee-cad625207853}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{0b2baaeb-0042-4dca-aa4d-3ee8648d03e5}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{20338b7b-531c-4aad-8011-f5b3db2123ec}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{24ccb8a6-c45a-477d-b940-3382b9225668}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{292108be-88ab-4f33-9a26-7748e62e37ad}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{36011842-dccc-40fe-aa3d-6177ea401788}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{3D1D4EA2-1D8C-418a-BFF8-F18370157B55}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{3f2a72a7-99fa-4ddb-a5a8-c604edf61d6b}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{3f98a740-839c-4af7-8c36-5badfb33d5fd}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{4dcafe13-e6a7-4c28-be02-ca8c2126280d}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{4F01EBC5-2385-41f2-A28E-2C5C91FB56E0}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{503a4e73-1734-441a-8eab-01b3f3861156}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{51294DA1-D7B1-485b-9E9A-17CFFE33E187}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{524ddb2b-2a4f-43b8-b8fe-e91ef9d8ba69}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{59BD6DD1-5CEC-4d7e-9AD2-ECC64154418D}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5c4f28b5-f869-4e84-8e60-f11db97c5cc7}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5f4eab9a-6833-4f61-899d-31cf46979d49}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{5fa96407-7e77-483c-ac93-691d05850de8}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{631958a6-ad0f-4035-a745-28ac066dc6ed}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{654a1b99-8a4b-4e7b-a4e1-46378ad77a61}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{672ECD7E-AF04-4399-875C-0290845B6247}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{71689ac1-cc88-45d0-8a22-2943c3e7dfb3}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{71D642A9-F2B1-42cd-AD92-EB9300C7CC0A}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{7d49d726-3c21-4f05-99aa-fdc2c9474656}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{7F2F5B96-FF74-41da-AFD8-1C78A5F3AEA2}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{7fde1a1e-8b31-49a5-93b8-6be14cfa4943}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{834d8a44-0974-4ed6-866e-f203d80b3810}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{885a186e-a440-4ada-812b-db871b942259}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{8faf9629-1980-46ff-8023-9dceab9c3ee3}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{921C636D-9FC8-40d7-899E-0845DCD03010}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{94d6ddcc-4a68-4175-a374-bd584a510b78}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{978e0ed7-92d6-4cec-9b59-3135b9c49ccf}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{982725ee-6f47-479e-b447-812bfa7d2e8f}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{B337FD00-9DD5-4635-A6D4-DA33FD102B7A}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{b3690e58-e961-423b-b687-386ebfd83239}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{c1f8339f-f312-4c97-b1c6-ecdf5910c5c0}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{C4D98F09-6124-4fe0-9942-826416082DA9}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{CD0FC69B-71E2-46e5-9690-5BCD9F57AAB3}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{da3f6866-35fe-4229-821a-26553a67fc18}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{db2a5d8f-06e6-4007-aba6-af877d526ea6}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{DD61BD66-70E8-48dd-9655-65C5E1AAC2D1}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{de2b70ec-9bf7-4a93-bd3d-243f7881d492}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{e053a11a-dced-4515-8c4e-d51ba917517b}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{ea25fbd7-3bf7-409e-b97f-3352240903f4}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{ef87b4cb-f2ce-4785-8658-4ca6c63e38c6}] +"Mode"=dword:00000004 + +[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Shell\Bags\AllFolders\Shell\{fbb3477e-c9e4-4b3b-a2ba-d3f5d3cd46f9}] +"Mode"=dword:00000004 diff --git a/psmodules/house_shopping.md b/psmodules/house_shopping.md index af1c9b4..da0d848 100644 --- a/psmodules/house_shopping.md +++ b/psmodules/house_shopping.md @@ -1,4 +1,10 @@ +## Use + + +Call `Add-Addresses` to copy records from `Addresses.csv` to `Address_Ddetails.csv`. + +Call `Add-AddressLocations` to fetch latitude and longitude for all addresses in `Address_Details.csv`. ## Reference diff --git a/psmodules/house_shopping.psm1 b/psmodules/house_shopping.psm1 index 819194b..908e9be 100644 --- a/psmodules/house_shopping.psm1 +++ b/psmodules/house_shopping.psm1 @@ -1,15 +1,89 @@ -function Get-TravelTimes() { +function Add-Addresses(){ + Param( + [string]$addressFile = "Addresses.csv", + [string]$outFile= "Address_Details.csv" + ) + Copy-Item $outFile "$outFile.backup" + $addressList = Get-Content $addressFile | ConvertFrom-Csv + $details = Get-Content $outFile| ConvertFrom-Csv + + $results = [System.Collections.ArrayList]@() + $known = [System.Collections.ArrayList]@() + + $details | ForEach-Object { + $idx = $results.Add($_) + $known.Add($_.Address) + } + $addressList | ForEach-Object { + if($known -NotContains $_.Address) + { + $idx = $results.Add($_) + $idx = Write-Host "Aadded " + $_.Address + } + } + $results | Format-Table + $answer = Read-Host -Prompt "Write updated file? y/N" + if($answer -Eq "y") { + $results | Export-Csv -NoTypeInformation -Path $outFile + Write-Host "Updated $outFile" + } +} + + +function Add-AddressLocations(){ + Param( + [string]$outFile= "Address_Details.csv" + ) + Copy-Item $outFile "$outFile.backup" + $details = Get-Content $outFile| ConvertFrom-Csv + $results = [System.Collections.ArrayList]@() + + $details | ForEach-Object { + $updated = $_ + if($_.lat -Eq $null) + { + Write-Host "Looking up position of " $_.Address + $coords= Get-MapCoords -Address $_.Address + $coords | Format-List + $updated.lat = $coords.lat + $updated.lon = $coords.lon + $updated | Format-List + } + $idx = $results.Add($updated) + } + $results | Select-Object Address, lat, lon | Format-List + $answer = Read-Host -Prompt "Write updated file? y/N" + if($answer -Eq "y") { + $results | Export-Csv -NoTypeInformation -Path $outFile + Write-Host "Updated $outFile" + } +} + + +function Add-TravelTimes() { + Param( + [string]$outFile= "Address_Details.csv" + ) + $details = Get-Content $outFile| ConvertFrom-Csv } $fuzzyUrl = "https://atlas.microsoft.com/search/fuzzy/json?&api-version=1.0&subscription-key={Your-Azure-Maps-Subscription-key}&language=en-US&query=pizza" +function Invoke-SubKeyCheck { + if($env:AzMapsSubKey -Eq $null) { + Write-Error "Please set env:AzMapsSubKey" + Exit + } +} + function Get-MapAddress() { param( [string]$address ) + Invoke-SubKeyCheck $subKey = $env:AzMapsSubKey $addyUrl = "https://atlas.microsoft.com/search/address/json?&subscription-key=$subKey&api-version=1.0&language=en-US&query=$address" $result = Invoke-WebRequest $addyUrl @@ -23,6 +97,7 @@ function Get-MapCoords() { param( [string]$address ) + Invoke-SubKeyCheck $subKey = $env:AzMapsSubKey $result = Get-MapAddress -Address $address return $result.results.entryPoints[0].position @@ -33,6 +108,7 @@ function Get-MapTravelPlan() { [string]$from_address, [string]$to_address ) + Invoke-SubKeyCheck $subKey = $env:AzMapsSubKey $pos1 = Get-MapCoords -Address $from_address $lat1 = $pos1.lat