Skip to content

Instantly share code, notes, and snippets.

@etusm
etusm / gist:35f711a812295ea5140564926112716e
Last active March 16, 2023 19:48
Rails 7 Swagger/Rswag setup tutorial for local API development stack

This is assuming you already have:

  1. An existing Ruby/Rails API
  2. Local server can start without issues

Steps:

  1. Add gem "rswag" to your Gemfile

  2. Add gem "rspec-rails" and gem "rswag-specs" to your Gemfile within the group :development, :test do...end block

@etusm
etusm / nestjs_cheat_sheet_etc.md
Last active November 21, 2022 19:00
NestJS Cheat Sheet

Nest.js Cheat Sheet

Install Nest CLI

  • npm i -g @nestjs/cli

Generator Commands

  • nest new <project-name> / The project-name directory will be created, node modules and a few boilerplate files will be installed, and a src/ directory will be created and populated with files.
  • nest generate controller / nest g co
@etusm
etusm / gist:e1cfb58fb10aacd399866e674d251d17
Created October 12, 2021 14:54
Ruby RestClient::Responses
RestClient::Response - 200, 207
RestClient::NotFound - 404
RestClient::Unauthorized - 401
RestClient::BadRequest - 400
RestClient::InternalServerError - 500
@etusm
etusm / Capybara Cheat Sheet
Last active August 15, 2018 09:52
Capybara Cheat Sheet
Capybara::DSL#methods:
accept_alert choose find_all has_no_content? has_unchecked_field? switch_to_frame
accept_confirm click_button find_button has_no_css? has_xpath? switch_to_window
accept_prompt click_link find_by_id has_no_current_path? html text
all click_link_or_button find_field has_no_field? open_new_window title
assert_all_of_selectors click_on find_link has_no_link? page uncheck
assert_current_path current_host first has_no_select? query unselect
assert_no_current_path current_path go_back has_no_selector? refute_selector visit
assert_no_selector current_scope go_forward