Skip to content

Instantly share code, notes, and snippets.

View MelissaKaulfuss's full-sized avatar

Melissa Kaulfuss MelissaKaulfuss

View GitHub Profile
@MelissaKaulfuss
MelissaKaulfuss / csv_and_postman.md
Last active June 20, 2018 00:17
Using a CSV with Postman
  1. Create a new collection in postman - only include actions you want to run in there.
  2. Give it a CSV with the amendments/fields, name the columns by the variables that postman expects.
  3. Remember to put the underscores in the column names in CSV.
  4. Add number of iterations for how many times you want it to happen.
@MelissaKaulfuss
MelissaKaulfuss / nightly_rates.md
Last active June 8, 2018 03:14
nightly_rates for CSRs

Nightly rates live in the provider_reservation_successful event.

@MelissaKaulfuss
MelissaKaulfuss / dup_ruby.md
Last active May 25, 2018 04:46
the dup method in ruby

What's this #dup method do?

Doing a code read today in our monthly 10% time I started to read and document an internal event sourcing framework we've built in our team. I stumbled across the .dup method and so naturally I got sidetracked (losing sight of the high level) with StackOverflow posts, Ruby-Doc and my own IRB comparisons between it, and another method that appears quite similar -clone.

Importantly dup differs from clone in that it duplicates the object as a completely new record (if it's an ActiveRecord object no id is assigned however if it's a PORO a new object_id is assigned so it's completely different). The duped object has no direct assocation with the original at all. Thus, if you modify a duped object, you won't change the original object and that's because it's a “shallow” copy – it copies the object’s attributes only, not its associations.

@MelissaKaulfuss
MelissaKaulfuss / push_to_booked.md
Last active May 31, 2018 00:23
Pushing blocked bookings to booked

New system

Find the booking_id, the correct resolution, fire up postman and 💥

Old system

  • ssh...
  • sudo su deploy
  • cd /app/<appname>/current/
  • bin/rails c
@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)

awsm tips

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

@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.
@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 / 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 / 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/*