Skip to content

Instantly share code, notes, and snippets.

View MelissaKaulfuss's full-sized avatar
🎯
Focusing

Melissa Kaulfuss MelissaKaulfuss

🎯
Focusing
View GitHub Profile
@MelissaKaulfuss
MelissaKaulfuss / aws_datamigration_service.md
Created April 28, 2017 10:58 — forked from wolfeidau/aws_datamigration_service.md
Conversation on viewsource slack about postgresql and AWS datamigration service.
@MelissaKaulfuss
MelissaKaulfuss / gist:6b109bccea81612c916672660b6a5ce6
Created September 6, 2017 07:11
Illustration of class methods and instance methods (I think!)
irb(main):001:0> class A
irb(main):002:1> def self.cow
irb(main):003:2> "hello I am a cow"
irb(main):004:2> end
irb(main):005:1> def moo
irb(main):006:2> "Mooooo!"
irb(main):007:2> end
irb(main):008:1> end
=> :moo
irb(main):009:0> A.cow
@MelissaKaulfuss
MelissaKaulfuss / no_code_in_docker_image.md
Last active January 16, 2018 22:25
No code in a Docker Image?

The issue

Yesterday when attempting to initialize /.init a Docker Container (for the first time) I got a strange error that I just assumed was down to my set up. Hadn't yet spun this up on my new machine.

The failure occurred when hitting exec bundle exec rake db:create.

The error output:

Gem::Exception: can't find executable rake for gem rake. rake is not currently included in the bundle, 
perhaps you meant to add it to your Gemfile?
@MelissaKaulfuss
MelissaKaulfuss / gist:2efc0b6419f4ecbf4c3a12421f00905b
Last active March 21, 2018 10:14
VCR gem grappling and learnings.

Today I had to add a parameter to a request we were sending to an external API.

My unit test passed ✅ The acceptance specs did not - I had 20 failures. ❌

The failures were super cryptic, something about not being able to merge Nil:NilClass into a hash or something weirdly unrelated. One of my colleagues suspected it was to do with the VCR gem we used to simulate HTTP requests/responses from APIs.

Turns out VCR uses query strings as the key for the cassette (I did not know this). Because I'd added a param to the query string, the existing string (in the cassettes) was broken.

@MelissaKaulfuss
MelissaKaulfuss / tailing_logs.md
Last active March 22, 2018 02:04
Tailing the logs in your rails app when you have no idea what's going wrong!

Go into the app folder and run: tail -f log/*

@MelissaKaulfuss
MelissaKaulfuss / docker_hints.md
Last active December 10, 2018 22:12
A bunch of docker commands/tips
  • Mounting apps locally use the branch that you have checked out locally.
  • When you want to execute a rails type of command inside a container:
    • docker-compose exec app_name <bundle update --source gem_name> where the command is the thing in the <>
  • try turning Docker daemon off and on again
  • To log in to a container to tail the logs docker-compose exec <container-name> bash then tail -f log/*logs
@MelissaKaulfuss
MelissaKaulfuss / git_workflow.md
Created April 10, 2018 03:27
Git rebase workflow

Nice git workflows

  1. Keep commits small/atomic
  2. Make use of fixup commits (for related changes) git commit --fixup sha
  3. If responding to a request/comment in PR reply with a comment like "Done in <commit-sha>", then:
  • git push origin head
  • git rebase -i origin/master --autosquash
  • Once there's a nice history: git push origin head -f
  • git checkout master && git merge br-name --ff-only
  1. Remember to run your specs again!
  2. git push origin master
@MelissaKaulfuss
MelissaKaulfuss / middleman_with_ted.md
Created April 12, 2018 06:56
Using Middleman Proxy with our Platform Docker containers

You can use mitmproxy which is an interactive HTTPS proxy.

  • Install it: brew install mitmproxy
  • In ted:
    • go to common-services.yml
    • find the relevant app_name-base ie. bookings-base, reservations-base
    • add HOOROO_PROXY: "http://middleman:8080"
  • Middleman is best viewed in Chrome.
  • The URL to view it in the browser is http://middleman.ted:8081
  • Run the Ted start script to restart the containers ./start
  • Spin up Postman, use the Epic in there to create your availability, make a booking etc.

awsm tips

Logging into a particular AWS environment: AWS_PROFILE=nonprod awsm ssh

@MelissaKaulfuss
MelissaKaulfuss / booking_platform_tips.md
Last active May 2, 2018 01:13
booking platform tips

Working with blocked bookings

  • in Shari find the blocked action, there's a resolutions block that suggests which resolution to do, in the "Bookings Resolutions" collection in postman use correct Resolution (you may need to edit an old one if it doesn't exist yet)