Skip to content

Instantly share code, notes, and snippets.

View andrewmcodes's full-sized avatar
🌱

Andrew Mason andrewmcodes

🌱
View GitHub Profile
# Going to refactor this with some knowledge i gained about our test suite
#
version: 2
jobs:
build:
docker:
# specify the version you desire here
- image: circleci/ruby:2.6.5-node-browsers
environment:
PG_HOST: localhost
@andrewmcodes
andrewmcodes / application_system_test_case.rb
Last active February 3, 2021 04:01
easily toggle between headless and browser in your system tests
require "test_helper"
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
# Watch tests execute in the browser with `WATCH=true` in your environment
# ex: WATCH=true bin/rails test:system
driven_by :selenium, using: ENV["WATCH"] == "true" ? :chrome : :headless_chrome
end
@andrewmcodes
andrewmcodes / Gemfile
Created July 11, 2020 21:25
HEY's Gemfile annotated with annotate_gem
# Generated with https://github.com/ivantsepp/annotate_gem/
ruby '2.7.1'
# Full-stack web application framework. (https://rubyonrails.org)
gem 'rails', github: 'rails/rails'
# Timezone Data for TZInfo (https://tzinfo.github.io)
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# ==== Action Text ====
@andrewmcodes
andrewmcodes / gist:a1ba6c025e3a2fc1f239f0d9dee449cb
Last active February 3, 2021 04:41
Creates an array of strings 1-12 and none
We couldn’t find that file to show.
@andrewmcodes
andrewmcodes / cloudSettings
Last active October 8, 2020 01:11
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-10-08T01:11:30.450Z","extensionVersion":"v3.4.3"}

Keybase proof

I hereby claim:

  • I am andrewmcodes on github.
  • I am andrewmcodes (https://keybase.io/andrewmcodes) on keybase.
  • I have a public key ASCULYBeXnW4WnfAmyTxt-5G2WowZm9PBJdA4zhEvkcV8wo

To claim this, I am signing this object:

@andrewmcodes
andrewmcodes / modules_explanation.rb
Last active November 21, 2020 06:56
stripe gem comments for Will
# stripe-ruby gem class example
# https://github.com/stripe/stripe-ruby/blob/master/lib/stripe/resources/checkout/session.rb
# Top level module - typically the gem name
# Reference: https://github.com/stripe/stripe-ruby/blob/master/lib/stripe.rb
# This file will either be directly required there or one of the other files
# it requires will require this.
module Stripe
# Stripes API is so large they had enough of a reason
# to separate the resource concern further. Typically
@andrewmcodes
andrewmcodes / shovel.rb
Created November 22, 2020 05:02
Blursed Ruby Shovels
🔥 = []
#=> []
🔥 << "digging" << "deeper" << "holes!" << "💎"
#=> ["digging", "deeper", "holes!", "💎"]
🔥.join(" ")
#=> "digging deeper holes! 💎"
@andrewmcodes
andrewmcodes / webpacker.yml
Created November 23, 2020 18:12
sample Webpacker config for TW
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: true
@andrewmcodes
andrewmcodes / 00_my_page_or_partial.html.erb
Last active January 10, 2021 00:17
OpenStruct example with Components in Rails/Bridgetown/etc. Hopefully you can follow this - I tossed it together quickly.
<%#
This is a page or partial in my Rails app.
While this is not how I typically use them,
I think it was a perfect example and exactly
why I reached for it today.
Here is a page with a simple component:
%>
<%= render FieldComponent.new(type: "email", name: "email_address", label: "Email Address") %>