Shortened, one line version of a spec

04/25/17  Public, Testing / TDD

Here is the full syntax version of a spec:

it "returns no results" do
  expect(results).to be_nil

Here is the same spec, in the shortened, one line version:

it { expect(results).to be_nil }

1 vote - harrylevine

Disable an ES lint rule - inline

04/24/17  Public, Other Languages

The linting error I was receiving was:

Do not mutate state directly. Use setState()

Here is an example of applying the inline disabling of the r...

1 vote - harrylevine

Expand out html tags in React jsx files using Emmet

02/18/17  Public, Shortcuts

control + e

turns span.blah into <span className="blah"></span>

1 vote - harrylevine

Shortcut for bringing up mission control in a Mac

01/16/17  Public, Shortcuts

control + up arrow

1 vote - harrylevine

Shortcut for highlighting URL in chrome

01/16/17  Public, Shortcuts

command + L

1 vote - harrylevine

Free course on how to contribute to an open source project

12/27/16  Public, Git

Great free course on how to contribute to an open source project. Includes all of the small, integral steps that are key to the contribution process.

Here are s...

1 vote - harrylevine

Creating a local copy of the routes.rb file to speed up your grepping of the routes

10/08/16  Public, Command Line, Rails General

Grepping your routes.rb file, for decent size projects, can take a long time. One solution to speed up this process is to create a local copy of the current state of your routes.rb ...

1 vote - harrylevine

before_* callbacks rollback transactions if its method returns false

10/05/16  Public, Rails Errors, Troubleshooting

I had a form, where in one of the fields, the user was clicking a drop-down menu, and choosing between one of three choices.

After the form was submitted, I had a callback that was doing something to the record.

When the user selected op...

1 vote - harrylevine

Encode an SVG file using base64 encoding

09/22/16  Public, Command Line, Tricks, Other Languages

Here is how to encode an SVG file, using base64 encoding, and then leverage the encoded string to set an element's background-image property to the SVG file in question.

1 - Open up an irb session
2 - Read the file into a variable, using...

1 vote - harrylevine