First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails
gem 'pry-rails', group: :development
Then you'll want to rebuild your Docker container to install the gems
require 'faker' | |
# Monkey Patch Arrays | |
class Array | |
# .mode | |
# sorts by the most popular and returns the highest frequency | |
def mode | |
each_with_object(Hash.new(0)) { |v, h| h[v] += 1 }.max_by(&:last) | |
end |
require 'rails_helper' | |
RSpec.describe 'Application', type: :request do | |
describe 'Tests our routes to make sure that the requests actually happen' do | |
it 'successfully gets the home page' do | |
get home_path | |
expect(response).to have_http_status(200) | |
end | |
it 'successfully gets the about page' do |
$email = "test@mail.com" | |
$valid_email = "test@mail.school.edu" | |
$valid_email_2 = "test@mail.edu" | |
$email_regex = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z\d\-]+)*\.[edu]+\z/i | |
$no_match = $email_regex.match $email | |
$valid_match = $email_regex.match $valid_email |
You can recover a MySQL database server password with the following five easy steps:
#!/usr/bin/env ruby | |
# require lib folder | |
Dir['./lib/*.rb'].each {|file| require file } | |
require 'benchmark' | |
@sum = Sum.new(1234) | |
avg_time = [] |
#!/usr/bin/env ruby | |
# require lib folder | |
Dir['./lib/*.rb'].each {|file| require file } | |
# require gems and modules | |
require 'random-word' | |
require 'benchmark' | |
avg_time = [] |
class Cat{ | |
constructor(name, color, type, legs = 4){ | |
this.name = name; | |
this.color = color; | |
this.type = type; | |
this.legs = legs; | |
this.hungry = true; | |
} | |
getName(){ |
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) --force |