Skip to content

Instantly share code, notes, and snippets.

@huezoaa
huezoaa / votersim_main.rb
Created January 26, 2015 22:03
voter simulation main
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
@huezoaa
huezoaa / votersim_classes.rb
Created January 26, 2015 22:04
voter sim classes
# Super Class Voter.
# Class variables:
#
module VoterSimClasses
class Voter
attr_accessor :name, :id, :type
def initialize
@huezoaa
huezoaa / stock_ticker.rb
Created January 30, 2015 20:16
Stock Ticker
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)
@huezoaa
huezoaa / stock_ticker_bonus.rb
Created January 30, 2015 20:37
Stock Ticket Bonus
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
@huezoaa
huezoaa / curl_ruby.rb
Last active August 29, 2015 14:14
Ruby Curl
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"
@huezoaa
huezoaa / my_api.rb
Created January 30, 2015 22:00
Spell Check API
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
@huezoaa
huezoaa / hola_miami.html
Created February 1, 2015 20:08
Hola Miami
<!DOCTYPE html>
<html>
<header>
<meta charset="UTF-8">
<title>Title goes here</title>
</header>
<body>
<h1>&iexcl;Hola Miami!</h1>
<h2>&Ccedil;a va?</h2>
@huezoaa
huezoaa / Input_Validation.html
Created February 5, 2015 20:50
Input Validation - JQuery homework
<!doctype html>
<html>
<head>
<meta charset="UTF­8"></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>
@huezoaa
huezoaa / Input_Validation.css
Created February 5, 2015 20:51
Input Validation - JQuery homework
.red {
color: red;
border-color: red;
}
@huezoaa
huezoaa / Input_Validation.js
Last active August 29, 2015 14:14
Input Validation - JQuery homework
$(function(){
$('input').change(function(x){
if (x.target.value !== "Wyncode"){
$(x.target).addClass('red');
};
});
})