Checking for rubocop offenses in a given file

11/07/17  Public, Testing / TDD

You can check what is/is not passing rubocop for a given file by calling:

rubocop app/whatever/whatever/my_file.rb

You can get even more output by passing it the -D flag, which adds the actual name of the cop.


1 vote - harrylevine

When making API call In postman, how to pass a JSON string

11/07/17  Public, Online Resources, Other Languages

  • after selecting POST
  • click the Body tab
  • click the raw radio button
  • select the JSON option from the drop-down
  • add the JSON code

1 vote - harrylevine

Favor everything on HEAD in a Git merge conflict

09/28/17  Public, Git

Let's say that you are rebasing your current branch on master, and you run into merge conflicts. For example with a blog.rb file. If you have a situation where you might be inclined to fix it by:

  • going to master
  • copying the entire ...

1 vote - harrylevine

Drop and recreate a rails database

08/31/17  Public, Databases

This will destroy your db and then create it and then migrate your current schema:

rake db:drop db:create db:migrate


1 vote - harrylevine

How to edit the /etc/hosts file

03/02/18  Public, Command Line, Online Resources

How to edit the / etc / hosts file:

For example, adding:    operationcode-psql 

to your /etc/hosts file enables you to run Rails app that uses Docker, withou...

1 vote - harrylevine

Iterate over a .yml file's contents

07/01/17  Public, Rails General, Ruby General

Let's assume that the .yml file (i.e. code_school.yml) is located in this directory:


You'll grab the path to the file, and load its contents:

config = Rails.root + 'config/code_schools.yml'

1 vote - harrylevine

Nested Rails Params Hash in a Form

06/11/17  Public, Rails General

When implementing a form object approach, you'll want to create a params hash with nested areas for attributes for two different models.

Note the `manager...

1 vote - harrylevine

Sublime text - jump to top of tree

05/07/17  Public, Shortcuts

  1. control + 0 focuses on the tree
  2. cmd + up-arrow jumps to the top of the tree

1 vote - harrylevine