Skip to content

Instantly share code, notes, and snippets.

View seajoshc's full-sized avatar
💾

Josh Campbell seajoshc

💾
View GitHub Profile
@seajoshc
seajoshc / json-golang.md
Last active December 13, 2023 05:24
The Ultimate Guide to JSON in Go [MIRROR]
title author date categories images
The Ultimate Guide to JSON in Go
Lane Wagner
2021-04-28
golang
/img/800/json_data.webp
@seajoshc
seajoshc / gistblog_introducing-gistblog.md
Last active November 11, 2023 18:24
Introducing Gistblog 🎉: Blog your little ❤️ out using GitHub Gists
@seajoshc
seajoshc / gistblog_pecan-pie.md
Last active December 23, 2021 01:26
Pecan Pie 🥧 Recipe: Sweet sugary goodness.

Josh's Blog - Pecan Pie 🥧 Recipe

Published on 2021-11-23

Hello internet, I wanted to share a pretty easy pecan pie recipe that just about anyone can do. There's so much sugary goodness that it still tastes good even if it doesn't come out perfect! If you try it out, let me know what you think.

@seajoshc
seajoshc / gistblog_reboot.md
Last active December 23, 2021 01:26
Reboot: New blog, who dis.

Josh's Blog - Reboot

Published on 2021-11-14

It's been a long time since I last blogged about anything. It's been a long time since I've felt like I had something to share. TBH I've been in a bit of a slump for a bit. Definitely a mental slump the last year or so, no thanks to covid. (Getting my booster next week 🙌 💉) But I've been in a professional slump for several years now. Feeling very little passion for what I do or for tech in general. Which has led to deep apathy for my work. Among other things, I feel like I haven't grown much professionally if I'm being honest with myself.

@seajoshc
seajoshc / gist:00cf79624dffbf36ed7e0c3937bfb558
Last active September 20, 2018 05:12
Makefile - jq base64
.PHONY: all base64 update_schema
all: base64_encode update_schema
base64_encode: buildspec.yaml
$(eval base64_encoded := $(shell cat *.yaml | base64))
update_schema: schema.json
@cat *.json | jq --arg base64_buildspec $(base64_encoded) '.name=$$base64_buildspec'
@patch('boto3.client') # Mock the boto3.client call to prevent using the boto3 library
def test_find_newest_artifact(mock_client): # Because we used the @patch decorator we need to add an argument for our mock'd client call
"""
test find_newest_artifact returns a properly formatted string
"""
# The normal "list_objects" function will return a dict.
# One key in the dict is "Contents" which is an list of the bucket objects.
# Each item in the "Contents" list has several keys, but if you look at the "find_newest_artifact"
# there are only two we are interested in: "Key" and "LastModified". So we need to fake a
# "list_objects" call and return a slimmed down version of the response we expect.
@seajoshc
seajoshc / remote_rails_console_cap2
Created April 24, 2015 14:45
Remote Rails Console cap 2 task
namespace :rails do
desc 'Remote rails console'
task :console, roles: :app do
run_interactively "rails console #{rails_env}"
end
desc 'Remote dbconsole'
task :dbconsole, roles: :app do
run_interactively "rails dbconsole #{rails_env}"
end