Skip to content

Instantly share code, notes, and snippets.

View rrgayhart's full-sized avatar

Romeeka Gayhart rrgayhart

View GitHub Profile
@rrgayhart
rrgayhart / gist:cf5dcefdf3975598f491
Last active June 26, 2022 06:09
Adding Sinon to WebPack

Adding Sinon to WebPack

  • Open your project (if you're using WebPack, obviously)

  • npm install sinon --save-dev

  • You should now have Sinon in your node modules and listed in your package.json file

  • In your tests, require Sinon: var sinon = require('sinon');

@rrgayhart
rrgayhart / gist:8188700
Created December 30, 2013 21:43
How to set up database cleaner and selenium testing and rspec
development and test gems
----------------------------------------------
group :development, :test do
gem 'sqlite3'
gem 'rspec-rails'
gem "capybara"
gem 'selenium-webdriver'
gem 'shoulda-matchers'
gem 'launchy'
@rrgayhart
rrgayhart / stubbing.md
Last active March 3, 2020 19:45
Webmock vs VCR for Testing External Calls

This is an excellent post that explains a little bit behind the difficulty in testing external services https://robots.thoughtbot.com/how-to-stub-external-services-in-tests How to Stub External Services in Tests

One simple option is to use Webmock

Here is an example of using Webmock in a similar way to what VCR does - which is recording and reading from a file

stub_request(:any, "www.example.com").
@rrgayhart
rrgayhart / require-1511.markdown
Created May 16, 2016 19:46
The Concept of Require

When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.

Read Node.js, Require and Exports and Organize Your Code with RequireJS

Fork this gist and answer the following questions:

  • In the context of Node, what is a module?
  • The code examples from the second blog post look very different from the first. Why?
@rrgayhart
rrgayhart / api-best-practices.markdown
Last active February 14, 2019 16:17
API Best Practices

The JSON API Standard

What is the JSON API Standard

The Specification

  • The History
  • Why does it exist?
    • Bike Shedding/LookingFor
  • Do we have to use it?
@rrgayhart
rrgayhart / twfdattrs.md
Last active June 23, 2018 18:48
Technical Writing For Developers: Attributions
@rrgayhart
rrgayhart / readmelove.md
Created August 25, 2014 14:51
README Love

##PROTIP: README Love

READMEs are AWESOME. They are one of the best things you can add to a repo, (other than quality code), to make it look professional.

####Things that make a README great:

  • A link to the production site on heroku
  • A screenshot (or a few) of what the app does (This is especially important if you don't have the production app up and running yet)
  • Directions on how to clone or fork the repo and run it locally (explain it like you're explaining things to a totally new programmer)

Keybase proof

I hereby claim:

  • I am rrgayhart on github.
  • I am rrgayhart (https://keybase.io/rrgayhart) on keybase.
  • I have a public key ASCMU9dJV7wzOm_Gmhn5jRqRXCtseZwBX7vW7IBatkYb8go

To claim this, I am signing this object:

@rrgayhart
rrgayhart / feedback.md
Created February 9, 2017 21:23
feedback.md
# poll.js

  def self.check_name(string)
    array = normal.select do |ingredient|
      string.downcase.include?(ingredient.downcase.pluralize) ||
      string.downcase.include?(ingredient.downcase)
    end
    if array.any?
 array.first
@rrgayhart
rrgayhart / 1608-refacktor-track.md
Last active February 6, 2017 18:07
Agenda Feb 6, 2017 - Refacktor Track (tor)