This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_movies(movie_list) | |
movie_list.each do |m| | |
puts "#{m.title} (rated: #{m.rating})" | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# set endpoint for TMDb API | |
export BASE=https://api.themoviedb.org/v3 | |
# set our API key for use in other calls | |
export KEY="my API key here" | |
# Search for a movie by keywords | |
curl "$BASE/search/movie?api_key=$KEY&query=Batman+Returns" | |
# For better legibility, pipe the output to json_pp: | |
curl "$BASE/search/movie?api_key=$KEY&query=Batman+Returns" | json_pp | |
# Start a new guest session | |
curl "$BASE/authentication/guest_session/new" | json_pp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ...other code from index.html.erb here... --> | |
<div class="row bg-dark text-white"> | |
<div class="col-6 text-center">Title and More Info</div> | |
<div class="col-2 text-center">Rating</div> | |
<div class="col-4 text-center">Release Date</div> | |
</div> | |
<%= render partial: 'movie', collection: @movies %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find largest element in a collection | |
def maximum(collection) | |
result = collection.first | |
collection.each do |item| | |
result = item if item > result | |
end | |
result | |
end | |
maximum([3,4,2,1]) # => 4 | |
maximum(["a","x","b"]) # => "x" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Jasmine basic check', function() { | |
it('works', function() { expect(true).toBe(true); }); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ...other code from index.html.erb here... --> | |
<div class="row bg-dark text-white"> | |
<div class="col-6 text-center">Title and More Info</div> | |
<div class="col-2 text-center">Rating</div> | |
<div class="col-4 text-center">Release Date</div> | |
</div> | |
<%= render partial: 'movie', collection: @movies %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rails_helper' | |
describe MoviesController do | |
describe 'searching TMDb' do | |
it 'calls the model method that performs TMDb search' | |
it 'selects the Search Results template for rendering' | |
it 'makes the TMDb search results available to that template' | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PS1="[`git branch --no-color 2>/dev/null | \ | |
sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`]% " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Roses are red, | |
Violets are blue. | |
<<<<<<< HEAD:poem.txt | |
I love GitHub, | |
======= | |
ProjectLocker rocks, | |
>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:poem.txt | |
and so do you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Pure leaf function: test critical values and noncritical regions | |
it 'occurs when multiple of 4 but not 100' do | |
expect(leap?(2008)).to be_truthy | |
end | |
it 'does not occur when multiple of 400' do | |
expect(leap?(2000)).to be_falsy | |
end | |
# 2. Using doubles for explicit dependencies such as collaborators | |
# UI.background() calls Defcon.level() to determine display color |