Settings file for "Oh My ZSH" command line interface

08/29/15  Public, Command Line

The file used to make settings adjustments for Oh My ZSH is a dotfile called .zshrc

It is located in the root ~ directory

1 vote - harrylevine

Step through pry sessions when debugging

08/18/15  Public, Testing / TDD

Adds step, next, finish and continue commands and breakpoints to Pry using byebug.

https://github.com/deivid-rodriguez/pry-byebug

Only supports MRI (ruby) 2.0.0 or newer. For MRI 1.9.3 or older, use pry-debugger

1 vote - harrylevine

String interpolation with single and double quotes dealing with escape characters

08/14/15  Public, Testing / TDD, Ruby General

This expectation does not recognize/interpolate the @volunteer.phone_number:

expect(response.body).to include('<Message to="#{@volunteer.phone_number}">Anybody home?</Message>')

By using Ruby programming *alternate double quo...

1 vote - harrylevine

Adding a unique constraint to a Postgres database column

08/11/15  Public, Databases

class AddUniqueConstraintToVolunteerPhoneNumber < ActiveRecord::Migration
  def change
    reversible do |dir|
      dir.up do
        execute 'ALTER TABLE volunteers ADD CONSTRAINT unique_phone UNIQUE (phone_number)'
      end
    ...

1 vote - harrylevine

Bring down a new Git branch from origin repo to your local repo

08/08/15  Public, Git

If there is a new branch out on the origin repo (in GitHub), and you do no have a copy of that branch in your local remote repo, here is what you will run to bring that copy down to your local remote repo:

$ git checkout master
$ git ...

1 vote - harrylevine

Add security with HTTPS

07/20/15  Public, Rails General

Simply use config.force_ssl = true in your environment configuration.

# config/application.rb
module MyApp
  class Application < Rails::Application
    config.force_ssl = true
  end
end

You can also selectively enable http...

1 vote - harrylevine

Testing for page content in an RSpec controller spec

07/19/15  Public, Testing / TDD

With RSpec, in a controller spec, you can still test for page content by adding render_views under the
describe block, and using expect(response.body).to have_content('blah blah blah')

require 'rails_helper'
require 'support/d...

1 vote - harrylevine

CSS stylesheet not being included in the application.css tree

07/16/15  Public, Other Languages

If the global application.css isn’t attempting to include per-view stylesheets, add something like this to the top of your view:

<%= stylesheet_link_tag 'support_calls/dashboard' %>

In this example, the path to the view file is...

1 vote - harrylevine

Git squash and merge two commits into one

08/13/15  Public, Git

http://stackoverflow.com/questions/2563632/how-can-i-merge-two-commits-into-one

$ git rebase --abort
$ git rebase --interactive HEAD~2

If you want to squash all of the commits back to origin/master run: $ git rebase -i master

You...

1 vote - harrylevine