Skip to content

Instantly share code, notes, and snippets.

View JAMSUPREME's full-sized avatar

JUSTIN SPENCER JAMSUPREME

View GitHub Profile
@JAMSUPREME
JAMSUPREME / 1_README.md
Last active March 10, 2021 16:24
General coding conventions and best practices

Overview

I'm cobbling this together as a very rough basis for coding conventions and best practices across different languages. As much as possible, I'll attempt to defer the guidance to something that is kept up-to-date and supplied by a reliable third party, e.g. "Use Rails and Rubocop"

Sections

I will attempt to break this down per-language, with a distinct section for general recommendations that span languages. I may also later add a section with some opinionated recommendations that I've seen used to good effect.

@JAMSUPREME
JAMSUPREME / 1_README.md
Last active September 6, 2022 17:05
Infrastructure Best Practices

Overview

This doc is aimed to provide some general guidance as to infrastructure best practices. It is by no means a rigid set of rules, but rather a handful of tips that may help.

Guidance

I attempted to break these recommendations into distinct files:

  • General FAQ and Tooling: General guidance in the form of a FAQ. Also contrasts some other tooling.
  • Terraform: General guidance regarding Terraform that I have found to improve productivity.
  • Local development: General guidance on how to improve local development
@JAMSUPREME
JAMSUPREME / README.md
Last active July 28, 2020 20:23
Devops migration highlights

Quick highlight of some big devops-y things.

About me

  • 11+ yrs coding
  • 6+ "devops" stuff
  • Some AWS certs (only got around to it this year)

Devops highlights

@JAMSUPREME
JAMSUPREME / README.md
Last active June 5, 2020 18:54
Feature toggle primer

Feature Toggle Primer

This is a quick primer on feature toggles. We'll go into:

  • What is a feature toggle?
  • Why use them?
  • How does it work?
  • How do I manage them?
  • What are the risks?
@JAMSUPREME
JAMSUPREME / get-ec2.yaml
Last active February 11, 2024 02:14
SSM Automation
description: |-
### EC2 stopper by tag
Stop EC2 instances by tag
schemaVersion: '0.3'
mainSteps:
- name: getInstancesByTag
action: 'aws:executeAwsApi'
outputs:
- Name: InstanceIds
@JAMSUPREME
JAMSUPREME / README.md
Last active March 24, 2020 16:22
CI/CD Primer

CI/CD Primer

This is designed to be a quick primer on Continuous Integration and Continuous Delivery. We will also use the term "Continuous Deployment" to mean a subset of Continuous Delivery in which you are delivering with every commit.

Acronyms and Terms

II/ID: Intermittent Integration & Delivery

For the sake of this discussion, we should have a term for "The opposite of CI/CD" and we'll call that "Intermittent Integration" and "Intermittent Delivery" so that we have a shared vocabulary.

@JAMSUPREME
JAMSUPREME / _stable.rb
Last active October 27, 2017 22:00
pipey
module Pipey
def <<(next_pipey)
if self.result.is_a?(EmptyPipe)
next_pipey.call
else
next_pipey.call(self.result)
end
end
# For self.execute
@JAMSUPREME
JAMSUPREME / hats.rb
Created September 8, 2017 18:31
Ruby private vs protected
class Hat
def explain
puts "You have a #{hat_type} hat!"
end
private
def hat_type
@JAMSUPREME
JAMSUPREME / 1_hefty_model.rb
Last active September 9, 2016 13:43
Abstractions v2 stuff
# Example of a few bad things (not a comprehensive list of bad ideas)
class Event < ActiveRecord::Base
# Less OK - scopes and retrieval helpers
scope :expensive, -> { where('desired_fee > 1000') }
scope :more_expensive_than, ->(cost) { where('desired_fee > ?', cost) }
def jan_events
where("strftime('%m', tentative_date) = 01")
end
# Not OK - arcane code that probably isn't reusable
@JAMSUPREME
JAMSUPREME / README.md
Last active February 1, 2019 21:10
Gem and app version mgmt

Overview

The purpose of this gist is to explain some recommendations for managing versions for gems and applications. Specifically, the concepts will be the following:

  • How do we version? What are the conventions for branches and releases?
  • When do we tag? Can I tag if it is not a release?
  • When do we branch, and how long should that branch live?
  • What is upstream and what is downstream?

By the time we reach the conclusion hopefully you've discovered the answers to all of these questions!