• About Recursion

    What is recursion? Yes, recursion is calling a method inside of itself; however…. There will always be a parameter/argument being passed into the method When the method is called inside itself, the parameter/argument must change before it’s passed in again It helps to think of Ruby as “pausing” the 1st...
  • Creating A Crud Api With Node And Postgres Using Express

    prerequisites Node Postgresql Postico steps to complete Setup create a database in Postgres create a table in the database add 2 users with name and email as dummy data Initialize Install Create an index.js require the express module require the body-parser middleware (baked in) Invoke Express to create the application...
  • Getting Started with Node.js

    Node.js It’s a way to write a backend with JavaScript. Among other things probably. the nodejs.dev website shows an example Node.js application, a server It’s creating a server; The closest I’ve ever got to a server with Rails was Puma. So this is going to expand my knowledge there. That’s...
  • GraphQL - Intro, Gems and Setup for a Rails API-only greenfield app

    table of contents 1. introduction 2. requirements 3. gems 4. setup 5. conclusion introduction How to set up GraphQL in an API-only rails app This is a reminder of how to setup an API-only Rails app as part of a Service-Oriented Architecture to operate as a microservice consuming a 3rd...
  • Setting up and using the Webmock gem

    Installation This gem is useful for faking API requests. Instead of a test suite making API calls for many unit tests, adding Webmock to a rails application Gemfile will “fake” those API calls. First I need to add the gem to the application. I usually add it directly from the...
  • Setting up and using VCR gem

    bundle add vcr -g 'test, development' bundle add webmock -g 'test, development' add the following to spec/spec_helper: require webmock/rspec add the following to spec/rails_helper: VCR.configure do |config| config.cassette_library_dir = "spec/fixtures/vcr_cassettes" config.hook_into :webmock config.filter_sensitive_data('<tmdb_api_key>') { ENV['tmdb_api_key'] } config.configure_rspec_metadata! end Now in any spec file that triggers a call to an API...
  • Quickly Consume An Api

    Get the API key Grab the Figaro gem, if not already in the Gemfile bundle exec figaro install to update the .gitignore file with /config/application.yml open /config/application.yml and add the key/value pair for the api_key: api_key_name: <api_key_goes_here> Double check the Gemfile for the Faraday gem create a directory: /app/services add...
  • How to install and configure factory_bot_rails

    Using factory_bot_rails Here’s how to use factory_bot_rails. Explanation of what FactoryBot is can be found at the end of the article, maybe…. pre-requisites: a working Rails app the Faker gem already installed and bundled As always, add the Gem quickly to an existing Rails app with the bundle add command:...