From fc8c6dc46d9b94ab9b5536420ba855761aeb1c95 Mon Sep 17 00:00:00 2001 From: "Wyatt J. Miller" Date: Mon, 4 Jul 2022 11:46:44 -0400 Subject: [PATCH] fixing/linting broken markdown --- .../_posts/2019-02-15-trying-golang.markdown | 56 +++++++++---------- src/blog/_posts/2019-10-05-loving-ps.markdown | 14 +++-- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/blog/_posts/2019-02-15-trying-golang.markdown b/src/blog/_posts/2019-02-15-trying-golang.markdown index 4ee37df..e66e752 100644 --- a/src/blog/_posts/2019-02-15-trying-golang.markdown +++ b/src/blog/_posts/2019-02-15-trying-golang.markdown @@ -6,54 +6,54 @@ published: true Golang (or Go, they are interchangeable and I will use it as such) has blown up over the recent years. For example, some features piqued my interest and when say piqued, I mean it. You probably aren't as hyped about Golang as I am. I suppose it helps when you are such a nerd about back-end and server development as well. -Right! Features (a few maybe?):
- * Concurrent
- * [Super-duper fast](https://stackshare.io/stackups/c-sharp-vs-go-vs-rust) when compared to Rust and C#.
- * Compilation support (super useful for sysadmins using GOOS, I found a [cool video](https://www.youtube.com/watch?v=hsgkdMrEJPs) about this, watched it to it's entirity)
- * Package management (Helpful for devs who use git and use platforms such as GitHub and GitLab)
- * Interpreter is long gone as Go is compiled (No longer are we in the days of Python and Ruby interpreters)
- * Static typing, for fans of that (C++, C#, Java, and Rust devs will know what I am talking about)
- * Managed version control repositories (also useful for devs using git)
- * Powerful standard library (flex, Golang, flex!) +Right! Features (a few maybe?): +- Concurrent +- [Super-duper fast](https://stackshare.io/stackups/c-sharp-vs-go-vs-rust) when compared to Rust and C#. +- Compilation support (super useful for sysadmins using GOOS, I found a [cool video](https://www.youtube.com/watch?v=hsgkdMrEJPs) about this, watched it to it's entirity) +- Package management (Helpful for devs who use git and use platforms such as GitHub and GitLab) +- Interpreter is long gone as Go is compiled (No longer are we in the days of Python and Ruby interpreters) +- Static typing, for fans of that (C++, C#, Java, and Rust devs will know what I am talking about) +- Managed version control repositories (also useful for devs using git) +- Powerful standard library (flex, Golang, flex!) Are you interested yet? I know I am! -What makes a Go program, you might ask? Hold up a sec: +What makes a Go program, you might ask? - -package main
+```go +package main -import(
-  "fmt"
-  "os"
-)
+import( + "fmt" + "os" +) -var name string = os.Args[1]
+var name string = os.Args[1] -func main(){
-  fmt.Println("Hello,", name)
-}
-
+func main(){ + fmt.Println("Hello,", name) +} +``` -Link to source [here.](https://wyattjmiller/code/main.go) +Link to source [here.](https://wyattjmiller.com/code/main.go) I'm back! A lot to take in, isn't there? I'm a beginner too so I will try my best to explain this to my utmost competency. So the the `package main` deal up top. You will need that to package that up if you want to share this awesome hello world app with your friends. -The `import` keyword imports packages to help with Go development. So, in this case, I'm importing the formatting tool, `"fmt"`, and the operating system tool, `"os"`, into my awesome hello world app which both packages are in the standard library. With that said, you could import other third party packages, like the ssh package. Since you can't find it [here](https://golang.org/pkg/), I looked on Golang's third party packages for ssh packages and it was pretty obvious that I'd find one. You'd just import:
+The `import` keyword imports packages to help with Go development. So, in this case, I'm importing the formatting tool, `"fmt"`, and the operating system tool, `"os"`, into my awesome hello world app which both packages are in the standard library. With that said, you could import other third party packages, like the ssh package. Since you can't find it [here](https://golang.org/pkg/), I looked for Golang's third party packages for ssh packages and it was pretty obvious that I'd find one. You'd just import: - -import(
-  "golang.org/x/crypto/ssh"
+```go +import( + "golang.org/x/crypto/ssh" ) -
+``` I think that's pretty neat as you have flexible package management built right in to Go. Next up, variables! Variables are a bit different as you have to declare them with a `var` and then the name of the variable and then the type of the variable. In my case, I need a variable called `name` with the `string` type because I know it's going to be `string` to begin with. Since Go is statically typed, this kind of breaks the rules (kind of like C# with the `var` keyword) but Go is super smart and can infer the type for you by using the `:=` operator. An example might help:
-`name := os.Args[1]`
+`name := os.Args[1]` Depending on what the argument is when the hello world app runs, it will infer the type for you. diff --git a/src/blog/_posts/2019-10-05-loving-ps.markdown b/src/blog/_posts/2019-10-05-loving-ps.markdown index d56f774..a66e23c 100644 --- a/src/blog/_posts/2019-10-05-loving-ps.markdown +++ b/src/blog/_posts/2019-10-05-loving-ps.markdown @@ -12,13 +12,19 @@ When I was at work one day, I was tasked with creating a Powershell script. Sinc You could use the .NET Framework inside your Powershell scripts. Knowing that I could use something that college actually taught me, I was ecstatic. Since I didn't know how write file paths in a reasonable way, I went looking around to see some examples some people had put together. Low and behold, I saw an example that had some .NET in it. Being Powershell is a Microsoft product, it made sense that .NET could live inside a Powershell script. -For example, you could use `System.Math` namespace in Powershell:
-`[System.Math]::Sqrt(36)` +For example, you could use `System.Math` namespace in Powershell: + +```powershell +[System.Math]::Sqrt(36) +``` to get the result `6`. -Want to read all the text in a file?
-`[System.IO.File]::ReadAllText('hello.txt')` +Want to read all the text in a file? + +```powershell +[System.IO.File]::ReadAllText('hello.txt') +``` Isn't that pretty cool??