back to simple blog module, loading posts with elixir map frontmatter, avoiding yaml package
This commit is contained in:
parent
80da842416
commit
f6c316d4fa
11 changed files with 200 additions and 149 deletions
20
priv/content/2016/2016-05-01_initial-test-post.md
Normal file
20
priv/content/2016/2016-05-01_initial-test-post.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
---
|
||||
%{
|
||||
title: "Markdown for blog posts is nice, says Sebastian",
|
||||
slug: "markdown-for-blog-posts",
|
||||
date: ~N[2016-05-01 13:30:00],
|
||||
author: "Adam Piontek",
|
||||
tags: ["sample", "demo"],
|
||||
summary: """
|
||||
This summary could get long.
|
||||
|
||||
We might even have multiple lines!
|
||||
"""
|
||||
}
|
||||
---
|
||||
|
||||
All the **Markdown** here...
|
||||
|
||||
```javascript
|
||||
console.log('hello world!')
|
||||
```
|
52
priv/content/2020/08/2020-08-01_enable_vs_cli_env_in_ps.md
Normal file
52
priv/content/2020/08/2020-08-01_enable_vs_cli_env_in_ps.md
Normal file
|
@ -0,0 +1,52 @@
|
|||
---
|
||||
%{
|
||||
title: "Enable Visual Studio CLI environment in PowerShell",
|
||||
date: ~N[2020-08-01 02:00:00],
|
||||
author: "Adam Piontek",
|
||||
tags: ["coding", "tech", "elixir", "windows", "powershell", "scripting"],
|
||||
}
|
||||
---
|
||||
|
||||
# Enable Visual Studio CLI environment in PowerShell
|
||||
|
||||
#coding #tech #elixir #windows #powershell #scripting
|
||||
|
||||
My initial problem: I have an elixir project I'm building primarily on linux, but I want it to work on Windows, too, and I'm using [bcrypt](https://github.com/riverrun/bcrypt_elixir), which [needs nmake to compile](https://github.com/riverrun/comeonin/wiki/Requirements#windows) on Windows.
|
||||
|
||||
One must install Visual Studio (VS), but that's not enough.<!--more--> Your terminal/PowerShell CLI environment won't know about VS by default. VS includes batch files to set up a dev environment, but if you run them in PowerShell, they bring you into a CMD environment, which is no help if you want to use PowerShell.
|
||||
|
||||
Luckily, thanks to [Michael Teter's blog](https://michaelteter.com/2018/07/06/compiling-Elixir-modules-in-Windows.html), and posts on github that mentioned the [VS Setup PS Module](https://github.com/microsoft/vssetup.powershell), I was able to put together a solution that works for me:
|
||||
|
||||
The built-in PowerShell (5.1 right now) will load a [profile](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-5.1) from (under user Documents folder): `WindowsPowerShell\Microsoft.PowerShell_profile.ps1` — and PS 7 (pwsh.exe) will load its [profile](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7) from the slightly different (under user Documents folder): `PowerShell\Microsoft.PowerShell_profile.ps1`
|
||||
|
||||
For each version where I want the environment set up, I place the following code in the profile:
|
||||
|
||||
```powershell
|
||||
function Invoke-CmdScript {
|
||||
param(
|
||||
[String] $scriptName
|
||||
)
|
||||
$cmdLine = """$scriptName"" $args & set"
|
||||
& $Env:SystemRoot\system32\cmd.exe /c $cmdLine |
|
||||
select-string '^([^=]*)=(.*)$' | foreach-object {
|
||||
$varName = $_.Matches[0].Groups[1].Value
|
||||
$varValue = $_.Matches[0].Groups[2].Value
|
||||
set-item Env:$varName $varValue
|
||||
}
|
||||
}
|
||||
|
||||
$installationPath = (Get-VSSetupInstance -All | Select-Object InstallationPath).InstallationPath
|
||||
$vcvars64Path = Join-Path -Path $installationPath -ChildPath "VC\Auxiliary\Build\vcvars64.bat"
|
||||
|
||||
if ($installationPath -and (Test-Path -Path $vcvars64Path)) {
|
||||
Invoke-CmdScript $vcvars64Path
|
||||
}
|
||||
```
|
||||
|
||||
As Michael explains:
|
||||
|
||||
> The function allows you to run a script, the one that makes the build tools visible, but instead of losing the context after that script ends, the settings are propogated back to the calling shell (Powershell).
|
||||
|
||||
> The profile then uses that Invoke-CmdScript function to call the vcvars64.bat script...
|
||||
|
||||
My addition is just to get the VS installation path from that VS Setup PS Module's `Get-VSSetupInstance` and build the script path from that. Hopefully that will survive future VS upgrades?
|
39
priv/content/2020/2020-12-29_moms-meatloaf.md
Normal file
39
priv/content/2020/2020-12-29_moms-meatloaf.md
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
%{
|
||||
title: "Mom's Meatloaf",
|
||||
date: ~N[2020-12-29 01:00:00],
|
||||
author: "Adam Piontek",
|
||||
tags: ["food", "recipe", "mealprep", "pandemiceats", "plaguecooking"],
|
||||
summary: "A meatloaf recipe from a very special mom"
|
||||
}
|
||||
---
|
||||
|
||||
Preheat oven to 350
|
||||
|
||||
So as you know, I just throw my meatloaf together, but here are my estimates based on a bunch of published recipes:
|
||||
|
||||
- Put 2 pounds ground beef (80/20) in a large bowl.
|
||||
- Squirt about 1/2 cup ketchup over it.
|
||||
- Sprinkle about a tablespoon of Worcestershire sauce over.
|
||||
- Throw in one egg (or 2, if you feel the need - I usually just use one).
|
||||
- Put in about 1 teaspoon horseradish
|
||||
- Put in about 1 teaspoon mustard
|
||||
- Sprinkle 1 packet of dry onion soup mix over
|
||||
- I have used bread (2 slices soaked like you're making meatballs and squeezed out) or oats (about 3/4 cup), or sometimes both depending on what I have or need to use up
|
||||
|
||||
You don't need any extra salt, everything you put in is pretty salty, grind some pepper on top
|
||||
|
||||
If you like you can put in a bit of mild hot sauce like Franks, Crystal, Louisiana hot sauce
|
||||
|
||||
Mix and squish everything together with your hands really well (make sure you wash them first!) (I don't think Justine will like this part). (Some recipes say to only mix loosely, I disagree.) Mixture should be nice and soft, but not so soft that you can't form it into a loaf (not as soft as I do for meatballs). I don't use a loaf pan, I shape it into an oval loaf. Do this in the pan you'll bake it in and then you don't have to grease it.
|
||||
|
||||
Squirt more ketchup over top, and spread all over the loaf (I use the back of a teaspoon to do this).
|
||||
|
||||
I like to bake it in a cast iron skillet, easier to clean and also you can make gravy in it if you like.
|
||||
|
||||
Bake at 350 for about an hour and 15 minutes. Internal temp should be 160. Let it stand a few minutes before slicing and serving with the classic accompaniments of mashed potatoes and corn.
|
||||
|
||||
If you want to make a gravy, pour off most of the fat from the pan, stir in flour to make a roux, add unsalted broth (beef or chicken or vegetable), cook and scrape the good stuff from the bottom of the pan. Drippings are pretty salty so unsalted liquid is essential, keep adding till flavor suits you.
|
||||
|
||||
Well, now you know all my secrets!
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue