Skip to content

Instantly share code, notes, and snippets.

@SViccari
SViccari / incorporating-runtime-data-on-ci.md
Last active April 7, 2022 16:14
Overview of how we're incorporating the RSpec runtime log data (using TeamCity as our CI service):

Overview of how we're incorporating the runtime log data (using TeamCity as our CI service):

  1. After a TeamCity build is completed, the runtime log file is stored in the Artifacts section for each build.
  2. Each new build runs a process that issues an API call to TeamCity. This API call looks for the latest, successful build and downloads the log file. That request something like this: HTTParty.get("#{team-city-uri}/builds/#{parameters-that-identify-a-completed-successful-build}/artifacts/content/parallel_rspec_runtime.log")
  3. After fetching the file, we read the file, remove any uwanted noise caused by stdout, and write the results to a new file.
  4. When calling parallel_tests, we pass the new file(1). Example: parallel_rspec --group-by runtime --runtime-log /logs/parallel_rspec_runtime.log -- path_to_spec_files

(1) Word of caution, Parallel Tests states that "when a runtime log is filled" the default group_by strategy is runtime. However, after digging into the source of the gem, we found t

@SViccari
SViccari / basic_setup.md
Last active July 26, 2021 19:58
Machine Customizations
@SViccari
SViccari / inclusivity-slackbot-responses.md
Created July 15, 2020 21:53
Slackbot Responses for Inclusivity

When someone says...

hey guys, hi guys, hey guyz, hi guyz, hey dudes, hi dudez, hey dudez, hi dudez, hey bros, hi bros, hey brahs, hi brahs, hey broz, hi broz, dudebros, bros, dudes, guys, brahs, you guys, you dudes, sup dudes, sup bros, sup brahs, sup guys, sup dudez

Slackbot responds...

May I suggest “everyone”? It's more gender-inclusive. May I suggest “all”? It's more gender-inclusive. May I suggest “people”? It's more gender-inclusive. May I suggest “y’all”? It's more gender-inclusive.

# revise the MedicationReconciliationCreator class
# to use the newly introduced NdcIdFormatter
class MedicationReconciliationCreator
# existing code to build a reconciled medication
def formatted_ndc_id(ndc_id)
NdcIdFormatter.format(ndc_id)
end
@SViccari
SViccari / ruby-unary-binary-operators.md
Created May 21, 2020 13:12
Ruby's Unary and Binary Operators

Ruby Unary and Binary operators

Ruby Unary Operators include: + - ~ ! * & !!

An Unary operator requires a single value to perform an operation. Examples:

The Integer unary minus operator - states the integer is a negative integer.

-5
@SViccari
SViccari / rails-info-routes.md
Last active December 8, 2019 22:16
TIL - view rails routes in browser

To view (locally) all routes for a rail's app, visit:

localhost:3000/rails/info/routes
@SViccari
SViccari / double_vs_instance_double.rb
Last active October 24, 2019 16:24
RSpec Double vs Instance Double
# RSpec Double vs Instance Double
# stub FeatureToggle using a double
def stub_feature_toggle_using_double
double(FeatureToggle, on?: true).tap do |feature_toggle|
allow(FeatureToggle).to receive(:new).and_return(feature_toggle)
end
end
# In the above example, we're stubbing out the response for "on?".
@SViccari
SViccari / csv_generator.rb
Created September 25, 2019 18:28
Generate CSV data
class CsvGenerator
def initialize(file_name, collection)
@file_name = file_name
@collection = collection
@columns = []
end
def register_column(column_header, &block)
columns << Column.new(column_header, block)
end
@SViccari
SViccari / button-vs-link.md
Last active May 20, 2019 15:37
Button Vs Link - A11Y
@SViccari
SViccari / git-tips.md
Last active April 7, 2019 19:47
Git Tips

In the example below, we will:

  • update our local master branch to include the latest changes in GitHub's master branch
  • create a new branch to make code changes. We'll call this branch my-new-branch.
  • save code changes as commits on my-new-branch
  • share my-new-branch with GitHub (with the intent of opening a PR)
  • use git's rebase feature to reduce the number of commits to one commit (this is often referred to as squashing commits)

Example Workflow

Update Master to pull in any recent changes