Skip to content

Instantly share code, notes, and snippets.

View wheelercj's full-sized avatar

Chris Wheeler wheelercj

View GitHub Profile
@wheelercj
wheelercj / .github(slash)workflows(slash)release.yml
Created January 11, 2024 21:00
GoReleaser GitHub Action -- don't forget to delete the Go patch version from go.mod
name: goreleaser
on:
push:
tags:
- '*'
permissions:
contents: write
@wheelercj
wheelercj / go.json
Last active August 16, 2023 05:29
VS Code snippet for Golang to return err if it's not nil. Just press alt+/ to insert the commonly used err-returning code.
{
"Return err if it's not nil": {
"prefix": "e?",
"body": [
"${TM_CURRENT_LINE/^(\\s*e\\?)|(\\s*if .+)|(\\s*)/${1:+if }${2:+ }${3:+if }/}err != nil {",
"\treturn${2} err",
"}",
]
}
}
@wheelercj
wheelercj / .pre-commit-config.yaml
Last active October 3, 2023 18:39
pre-commit config for Python
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.9.1
hooks:
@wheelercj
wheelercj / launch.json
Created August 2, 2022 17:02
VSCode launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: main.py (Integrated Terminal)",
"type": "python",
"request": "launch",
@wheelercj
wheelercj / main.cpp
Last active August 17, 2023 06:10
Solutions to "practice: printing shapes with loops" https://wheelercj.github.io/notes/pages/20200522233055.html
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
// *****
for (int i = 0; i < 5; i++)
cout << '*';
@wheelercj
wheelercj / main.cpp
Last active May 5, 2022 20:10
full example solution for the second set of practice problems in "intro to recursion with C++" here: https://wheelercj.github.io/notes/pages/20220502232349.html
#include <iostream>
using namespace std;
struct Node {
int value = 0;
Node* next = NULL;
Node(int new_value) {
value = new_value;
}
};
@wheelercj
wheelercj / codeblock of categorical-index.md
Last active August 16, 2023 05:32
Here's what my website's[1] categorical-index.md looks like before my SSG edits it and converts to HTML. Note that there is an empty line at the top of the file so that the `#published` tag is not at the very beginning of the file; it would not be correctly detected by zk-ssg otherwise. [1]: https://wheelercj.github.io/notes/
  
#published
## resources
#resources

## learning
#learning

## computer science