This file contains 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 "./votersim_classes.rb" | |
include VoterSimClasses | |
def greet_and_choose | |
puts "\n\n\n\n\n\n\n\n\n\n" | |
puts "What would you like to do????" | |
puts "Create, List, Update, Vote, or Exit" | |
gets.chomp.downcase | |
end |
This file contains 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
# Super Class Voter. | |
# Class variables: | |
# | |
module VoterSimClasses | |
class Voter | |
attr_accessor :name, :id, :type | |
def initialize |
This file contains 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 'HTTParty' | |
require 'json' | |
require 'nokogiri' | |
### run a GET from Yahoo with HTTParty for Apple Stock, assign to response | |
response = HTTParty.get('http://finance.yahoo.com/q?s=AAPL') | |
### take response body and use Nokogiri to parse the HTML into a Ruby variable | |
ticker = Nokogiri::HTML(response.body) |
This file contains 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 'HTTParty' | |
require 'json' | |
require 'nokogiri' | |
### Obtain stock symbol: | |
puts "Please enter your Stock Symbol:" | |
stock_symbol = gets.chomp | |
address = "http://finance.yahoo.com/q?s=" + stock_symbol | |
# puts address |
This file contains 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 'httparty' | |
# puts ARGV | |
# p ARGV | |
#### Hint: When you pass arguments to Ruby through the Command Line, | |
#### they get set into a Constant Array variable named ARGV. | |
case ARGV[0] | |
when "GET" |
This file contains 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 'httparty' | |
require 'json' | |
puts "Please enter the word to spell-check:" | |
##### Get word to spell check from the user | |
word = gets.chomp | |
address = "https://montanaflynn-spellcheck.p.mashape.com/check/?text=" + word |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<header> | |
<meta charset="UTF-8"> | |
<title>Title goes here</title> | |
</header> | |
<body> | |
<h1>¡Hola Miami!</h1> | |
<h2>Ça va?</h2> |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="UTF8"></meta> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> | |
<script src="Input_Validation.js"></script> | |
<link rel="stylesheet" type="text/css" href="Input_Validation.css" /> | |
<title>InputValidation</title> |
This file contains 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
.red { | |
color: red; | |
border-color: red; | |
} |
This file contains 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
$(function(){ | |
$('input').change(function(x){ | |
if (x.target.value !== "Wyncode"){ | |
$(x.target).addClass('red'); | |
}; | |
}); | |
}) | |