Skip to content

Instantly share code, notes, and snippets.

View markmccanna1's full-sized avatar

Mark McCanna markmccanna1

View GitHub Profile

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.
@markmccanna1
markmccanna1 / carousel.js
Created August 16, 2013 00:26 — forked from ksolo/carousel.js
Image Carousel
@markmccanna1
markmccanna1 / form-validator.js
Last active December 21, 2015 03:39 — forked from ksolo/form-validator.js
Form Validation
// shorthand for $(document).ready();
$(function(){
//Your code...
$('form').on('submit', function(event) {
event.preventDefault();
var array = $('form').serializeArray();
// console.log(array)
@markmccanna1
markmccanna1 / zoo.js
Last active December 21, 2015 03:29 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
var Zoo = {
init: function(animals){
//do i need to make an array and iterate through the argument?
self.animals: animals;
},
@markmccanna1
markmccanna1 / index.html
Last active December 21, 2015 03:19 — 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>
<img src="/<%= @roll.value %>.png" title="<%= @roll.value %>" alt="the roll">
@markmccanna1
markmccanna1 / student.rb
Created August 1, 2013 02:44
active records associations
require_relative '../../db/config'
require 'time'
require 'sqlite3'
class Student < ActiveRecord::Base
# implement your Student model here
has_and_belongs_to_many :teachers
validates :age, numericality: { only_integer: true,
greater_than: 4 }
validates :email, format: { with: /.+@.+[.].{2,}/,
message: "wrong format, biatch"}
@markmccanna1
markmccanna1 / create_students.rb
Last active December 20, 2015 11:59
students.rb
require_relative '../config'
# this is where you should use an ActiveRecord migration to
class CreateStudents < ActiveRecord::Migration
def change
# HINT: checkout ActiveRecord::Migration.create_table
create_table :students do |t|
t.string :first_name
t.string :last_name