Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ add new doc sections, fix gitter style, fix searchbox alignme…
…nt. woot woot
- Loading branch information
1 parent
b6ee917
commit 4c7d920
Showing
14 changed files
with
154 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
--- | ||
title: go | ||
date: 2020-10-30 | ||
toc: true | ||
excerpt: | ||
A cheatsheet to update with what I pickup with Go that I likely need to reference again as a new gopher. | ||
slug: go | ||
permalink: /docs/go | ||
comments: true | ||
tags: | ||
- development | ||
- golang | ||
--- | ||
|
||
|
||
## Starter Template | ||
|
||
I saved this as a snippet for vscode to get up and running quickly with something better than the defaults for handling `func main` isolation. | ||
I've been working on modifying this a bit as I don't really like using args, but am trying not to overcomplicate things as a new gopher. | ||
|
||
I tend to like better flag parsing than using args, but it's still a better pattern to get functions isolated from main to easily test. | ||
|
||
The gist that I've taken from this and discussions in the community is ensure that `main` is where program termination is dedicated instead of handling this in your functions. | ||
This isolation of logic from main ensures you can more easily setup your tests as well, since `func main()` isn't testable. | ||
|
||
```go | ||
package main | ||
|
||
// package template from: | ||
import ( | ||
"errors" | ||
"fmt" | ||
"io" | ||
"os" | ||
) | ||
|
||
const ( | ||
// exitFail is the exit code if the program | ||
// fails. | ||
exitFail = 1 | ||
) | ||
|
||
func main() { | ||
if err := run(os.Args, os.Stdout); err != nil { | ||
fmt.Fprintf(os.Stderr, "%s\n", err) | ||
os.Exit(exitFail) | ||
} | ||
} | ||
|
||
func run(args []string, stdout io.Writer) error { | ||
if len(args) == 0 { | ||
return errors.New("no arguments") | ||
} | ||
for _, value := range args[1:] { | ||
fmt.Fprintf(stdout, "Running %s", value) | ||
} | ||
return nil | ||
} | ||
|
||
``` | ||
|
||
## Puzzles - FizzBuzz | ||
|
||
I honestly had never done any algorithm or interview puzzles beyond sql-server, so I was really happy to knock this out relatively easily. | ||
At least I pass the basic Joel test 😁 | ||
|
||
{{< gist "25309ea04d1646f26bc0f4a54e0f16af" >}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
--- | ||
title: shell | ||
date: 2020-10-30 | ||
toc: true | ||
excerpt: | ||
A cheatsheet for some bash stuff. I really ♥️ pwsh... but acknowledge it's not everyone's cup of tea. | ||
This page helps me get by with being a terrible basher | ||
slug: shell | ||
permalink: /docs/shell | ||
comments: true | ||
tags: | ||
- development | ||
- shell | ||
--- | ||
|
||
|
||
## Installing go-task | ||
|
||
This tool is great for cross-platform shell scripting as it runs all the commands in the `Taskfile.yml` using a built in go shell library that supports bash syntax (and others). | ||
|
||
Quickly get up and running using the directions here: [Install Task](https://github.com/go-task/task/blob/master/docs/installation.md) | ||
|
||
```shell | ||
# For Default Installion to ./bin with debug logging | ||
sh -c "$(curl -ssL https://taskfile.dev/install.sh)" -- -d | ||
# For Installation To /usr/local/bin for userwide access with debug logging | ||
# May require sudo sh | ||
sh -c "$(curl -ssL https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters