To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
<h1>Create a new recipe</h1> | |
<%= form_tag '/recipes' do%> | |
<%=label_tag 'recipe[name]', 'Enter Recipe:'%> | |
<label for="recipe[name]">Enter Recipe:</label> | |
<%=text_field_tag 'recipe[name]'%><br> | |
<input name="recipe[name]"> | |
<%=label_tag 'recipe[ingredients_to_add][]', 'Enter Ingredient:'%> | |
<%=text_field_tag 'recipe[ingredients_to_add][]'%><br> |
# From [Rubeque](http://rubeque.com/problems/reverse-each-word) | |
# Write a method that takes a sentence and returns it with each word reversed in place. | |
# ruby | |
# reverse_each_word.rb | |
# Write a method that takes a sentence and returns it with each word reversed in place. | |
# A String has many methods that can be called on it: | |
# http://www.ruby-doc.org/core-1.9.3/String.html |
songs = [ | |
"The Phoenix - 1901", | |
"Tokyo Police Club - Wait Up", | |
"Sufjan Stevens - Too Much", | |
"The Naked and the Famous - Young Blood", | |
"(Far From) Home - Tiga", | |
"The Cults - Abducted", | |
"The Phoenix - Consolation Prizes" | |
] | |
class Song |
def check_prime(number) | |
check_max = (2..number-1) | |
if (check_max.all? {|divisor| number % divisor != 0}) | |
puts "This number is prime" | |
else | |
puts "This number is not prime" | |
end | |
end | |
check_prime(5) |
game = { | |
:team_1 => {:name => "Knicks", | |
:colors => ["Blue", "Orange"], | |
:players => { | |
:player_1=> { | |
:name => "Amar'e Stoudemire", | |
:number => 5, | |
:shoe_size => 12, | |
:stats => { | |
:points => 20, |
def temperature_bot(temp) | |
case temp | |
when 18..21 | |
"I like this temperature" | |
else | |
"This is uncomfortable for me" | |
end | |
end |
my_array = ["j","e","t","s","g","i","a","n","t","s"] | |
puts my_array.slice(0,4).join.prepend('j.e.t.s.').gsub("j", "J") |
movies = { | |
:comedy => [ | |
"Wedding Crashers", | |
"Superbad", | |
"Anchorman" | |
] | |
:action => [ | |
"Bourne Ultimatum", | |
"Skyfall", | |
"Mission Impossible" |
# 1. Construct an array with your favorite foods. It should have at least 5 elements | |
favorite_foods = ["pav bhaji", "pizza", "falafel", "burrito", "egg & cheese"] | |
# Write a puts which returns your most favorite food out of the array. | |
puts favorite_foods[0] | |
# Construct an array with the colors of the rainbow (ROYGBIV) | |
rainbow_array = ["red", "orange", "yellow", "green", "blue", "indigo", "violet"] | |
# Slice the colors Red, Orange, and Yellow out of the array. |