Skip to content

Instantly share code, notes, and snippets.

View jdheyburn's full-sized avatar
👋
Heya!

Joseph Heyburn jdheyburn

👋
Heya!
View GitHub Profile
@jdheyburn
jdheyburn / function.tmpl
Created April 29, 2019 13:52
Custom template for gotests to generate tests that perform stricter error testing
{{define "function"}}
{{- $f := .}}
func {{.TestName}}(t *testing.T) {
{{- with .Receiver}}
{{- if .IsStruct}}
{{- if .Fields}}
type fields struct {
{{- range .Fields}}
{{Field .}} {{.Type}}
2019/08/02 13:02:54 [INFO] Terraform version: 0.12.6
2019/08/02 13:02:54 [INFO] Go runtime version: go1.12.4
2019/08/02 13:02:54 [INFO] CLI args: []string{"/usr/local/Cellar/tfenv/0.6.0/versions/0.12.6/terraform", "apply"}
2019/08/02 13:02:54 [DEBUG] Attempting to open CLI config file: /Users/jheyburn/.terraformrc
2019/08/02 13:02:54 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/08/02 13:02:54 [INFO] CLI command args: []string{"apply"}
2019/08/02 13:02:54 [DEBUG] New state was assigned lineage "0299013c-e58d-2e11-3418-96bded058df5"
2019/08/02 13:02:54 [DEBUG] checking for provider in "."
2019/08/02 13:02:54 [DEBUG] checking for provider in "/usr/local/Cellar/tfenv/0.6.0/versions/0.12.6"
2019/08/02 13:02:54 [DEBUG] checking for provider in ".terraform/plugins/darwin_amd64"
#!/bin/bash
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
# Build the project.
hugo # if using a theme, replace with `hugo -t <YOURTHEME>`
# Copy CNAME to public
cp CNAME ./public/
dist: xenial
git:
depth: false
env:
global:
- HUGO_VERSION="0.58.3"
matrix:
secure: REDACTED
name: Build and deploy to jdheyburn.github.io
on:
push:
branches:
- master
schedule:
- cron: "0 10 * * *"
jobs:
@jdheyburn
jdheyburn / hugo_layouts_posts_single.html
Last active April 14, 2020 07:52
A hugo-coder modification to allow emojified titles and table of contents
{{ define "title" }}
{{ if .Site.Params.enableEmoji }}
{{ .Title | emojify }} · {{ .Site.Title | emojify }}
{{ else }}
{{ .Title }} · {{ .Site.Title }}
{{ end }}
{{ end }}
{{ define "content" }}
<section class="container post">
<article>
@jdheyburn
jdheyburn / hugo_layouts_posts_li.html
Created April 15, 2020 07:11
A hugo-coder modification to allow emojified titles in type lists
<li>
<span class="date">{{ .Date.Format (.Site.Params.dateFormat | default "January 2, 2006" ) }}</span>
<a class="title" href="{{ .Params.ExternalLink | default .RelPermalink }}">{{ .Title | emojify }}</a>
</li>
@jdheyburn
jdheyburn / hugo_rss.xml
Last active December 23, 2022 02:52
Modifications made to Hugo's RSS templating XML to produce full content and cards
{{- $pctx := . -}}
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
{{- $pages := slice -}}
{{- if or $.IsHome $.IsSection -}}
{{- $pages = $pctx.RegularPages -}}
{{- else -}}
{{- $pages = $pctx.Pages -}}
{{- end -}}
{{- $limit := .Site.Config.Services.RSS.Limit -}}
{{- if ge $limit 1 -}}
{
"apps": {
"http": {
"servers": {
"srv0": {
"listen": [
":443"
],
"routes": [
{
@jdheyburn
jdheyburn / function.tmpl
Created July 16, 2020 21:27
Modified gotest template files allowing for enhanced error testing in Go
{{define "function"}}
{{- $f := .}}
func {{.TestName}}(t *testing.T) {
{{- with .Receiver}}
{{- if .IsStruct}}
{{- if .Fields}}
type fields struct {
{{- range .Fields}}
{{Field .}} {{.Type}}