Skip to content

Instantly share code, notes, and snippets.

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@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;
$('#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"});

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.
@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,}/;
@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>