Skip to content

Instantly share code, notes, and snippets.

require 'nokogiri'
require_relative 'utils'
require 'open-uri'
class Scraper
def initialize(path)
@doc = Nokogiri::HTML(File.open(path))
end
@AndrewGuard
AndrewGuard / application.css
Last active December 25, 2015 13:09
javascript_rubyracer
.container {
margin: 20px auto;
width: 600px;
padding: 0px 20px 20px 20px;
border: 1px dotted black;
}
.racer_table td {
background-color: white;
height: 20px;
@AndrewGuard
AndrewGuard / index.html
Last active December 25, 2015 18:59 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
@AndrewGuard
AndrewGuard / form-validator.js
Last active December 25, 2015 19:59 — forked from ksolo/form-validator.js
Form Validation
// shorthand for $(document).ready();
$(function(){
$("form").submit(function(e) {
e.preventDefault();
$('#error').html("");
var password = this.password.value;
var email = this.email.value
console.log(password);
var check_email = /^\w+@[a-zA-Z_]+?\.[a-zA-Z]{2,3}$/;
var check_length = /.{8,}/;

Instructions:

  1. Download this application skeleton.
  2. Convert the app to use AJAX.
  3. Add any files you changed to your gist and submit your code.
$('#main-content').css("background-color", "blue");
$('h2').css("background-color", "pink");
$( "h1, h2" ).css('font-style', 'italic' );
$('.select-menu-button-gravatar').find('img').attr('src', "http://upload.wikimedia.org/wikipedia/commons/2/22/Turkish_Van_Cat.jpg");
$("ol").find('li').animate({height: "+=50"});
@AndrewGuard
AndrewGuard / zoo.js
Last active December 27, 2015 16:49 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
Zoo = {"animal" : "legs"}
console.log(Zoo["animal"])
function Animal(species, legs) {
this.species = species;
@AndrewGuard
AndrewGuard / gist:7371992
Last active December 27, 2015 18:48
Zoo-object_oriented_javascript
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
var Zoo = {}
Zoo.init = function(list_of_animals) {
this.animals = list_of_animals
}
puts "Type a word (or press enter to finish):"
word = gets.chomp
word_list = []
word_list << word
until word == ""
puts "Type a word (or press enter to finish):"
word = gets.chomp
word_list << word
end