Add all Google Fonts to Sketch 3

10/03/15  Public, Online Resources


All you have to do is paste the code below into Terminal:

curl | sh

If yo...

1 vote - harrylevine

In a controller spec, calling a PUT or POST action

09/18/15  Public, Testing / TDD

From users_controller_spec.rb:

put :update, :id =>, :user => { :active => false }

1 vote - harrylevine

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.

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)'

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

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