You will be creating a movies app using Sinatra and the OMDB API.
- Ability to search for a movie by title
- Ability to click on a search result to see detailed information about a movie including:
- Title
- Year
| def valid?(card_number) | |
| digits = card_number | |
| .split("") | |
| .map { |number| number.to_i } | |
| numbers = [] | |
| digits.each_with_index do |digit, index| | |
| if index.even? | |
| numbers << digit * 2 | |
| else |
| <script type="text/javascript"> | |
| $(document).ready(function(){ | |
| $.stratus({ | |
| auto_play: true, | |
| download: false, | |
| key: "Enter your Client ID here", | |
| links: 'http://soundcloud.com/qotsa', | |
| random: true | |
| }); | |
| }); |
| <script type="text/javascript"> | |
| $(document).ready(function(){ | |
| $.stratus({ | |
| key: "Enter your Client ID here", | |
| links: "https://soundcloud.com/zedsdead/sets/somewhere-else-ep" | |
| }); | |
| }); | |
| </script> |
| require 'csv' | |
| require 'twitter' | |
| def twitter_client | |
| @twitter_client ||= Twitter::REST::Client.new do |config| | |
| config.consumer_key = 'XXXXXX' | |
| config.consumer_secret = 'XXXXXX' | |
| config.access_token = 'XXXXXX' | |
| config.access_token_secret = 'XXXXXX' | |
| end |
| # Node A: | |
| # iex --sname "nodea" | |
| Process.register self, :iex | |
| # Blocking | |
| receive do | |
| { :hello, pid } -> | |
| IO.puts "Hello from #{inspect(pid)}" | |
| end |
| defmodule Future do | |
| def new(fun) do | |
| fn(x) -> | |
| spawn_link fn -> | |
| value = try do | |
| { :ok, fun.(x) } | |
| rescue | |
| e -> { :error, e } | |
| end |
| require 'json' | |
| require 'open-uri' | |
| require 'uri' | |
| class GoogleProductsSearch | |
| def self.find_all_by_query(query) | |
| file = open("https://www.googleapis.com/shopping/search/v1/public/products?key=#{ENV["GOOGLE_PRODUCTS_API_KEY"]}&country=US&q=#{URI.escape(query)}") | |
| JSON.load(file.read)["items"] || [] | |
| end |
You will be creating a movies app using Sinatra and the OMDB API.
Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
Consumer key: iAtYJ4HpUVfIUoNnif1DA
| # app/controllers/users/password_controller.rb | |
| class Users::PasswordsController < Devise::PasswordsController | |
| def resource_params | |
| params.require(:user).permit(:email, :password, :password_confirmation, :reset_password_token) | |
| end | |
| private :resource_params | |
| end |