Skip to content

Instantly share code, notes, and snippets.

Javascript/JQuery workout

Exercises for fun

ex_1.js

Using only js

SUGGESTION 1:
--------------------------
Consider combining Location into Airport model ie:
Insead of
Location.lat
Location.long
Location.id
# There are 4 basic steps to implementing your ActionMailer functionality in a Rails app:
# Step 1. Create your ActionMailer object. Remember that it can have any name, but should finish with "Mailer":
rails g mailer UserMailer
class UserMailer < ActionMailer::Base
default from: "fred@fred.com"
def confirm_user(user)
@user = user
@panicbus
panicbus / index.md
Created October 22, 2013 04:03 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

##jQuery

###Basics

  • Little bit of background on jQuery
  • How to include it
  • How to make sure it's included and works
  • How to use the documentation to explore methods (in the course of this class)

###Select elements and add property $('#topsquare').addClass('white-text');

@panicbus
panicbus / debug_1.md
Last active December 24, 2015 17:09 — forked from OfTheDelmer/debug_1.md

#Debugging (Use The Duck… )

Find the errors in the following

1.)

require 'sinatra'
require 'sinatra/reloader'
require 'yahoofinance'
get '/' do
@method = "post"
@action = "/stock"
erb :form
@panicbus
panicbus / gist:6771970
Last active February 20, 2017 23:53 — forked from spencereldred/gist:6766356
Spencer's Happy Tails
# happy_tails.rb
# Spencer Eldred
# Sept 27, 2013
# Activity:
# You are the manager at HappiTails animal shelter. You need to manage your shelter by storing and manipulating information about clients and animals.
# Object Specs:
# Animal:
# An animal should have a name, an age, a gender, a species, and can have multiple toys.
@panicbus
panicbus / gist:6746612
Created September 28, 2013 21:13 — forked from featherart/gist:6745715
Feather's array review quiz
# create an Array of 4 shoes
# iterate through your Array using each and {}'s
# and show a list of your shoes
# create an Array of 4 outfits using Array.new
@panicbus
panicbus / gist:6735117
Last active December 24, 2015 03:09 — forked from featherart/gist:6734826
This is Quiz1. I made it through the hashes part only. Also, couldn't get my array to only print once.
# This is our first week's !quiz Let's find out what we know.
#
# The ideal range of your motor cycle speed 20 - 55. Over 55 is SCAREE!
# Check if your moto_speed is within that range using boolean (&&, ||)
# operators and comparison operators (== =< >= !=)
# if your moto_speed variable is in the right range print out a good
# message, aka "Wheee!" Otherwise print out an appropriate response.