- Download this application skeleton.
- Convert the app to use AJAX.
- Add any files you changed to your gist and submit your code.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LilC:Sites corey$ cd demos.dev/ | |
LilC:demos.dev corey$ git status | |
# On branch master | |
nothing to commit (working directory clean) | |
LilC:demos.dev corey$ git checkout develop | |
Branch develop set up to track remote branch develop from origin. | |
Switched to a new branch 'develop' | |
LilC:demos.dev corey$ git pull | |
Already up-to-date. | |
LilC:demos.dev corey$ git flow init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def valid_triangle?(a, b, c) | |
s = (a + b + c) / 2.0 | |
not_triangle = (s - a) * (s - b) * (s - c) | |
if not_triangle <= 0 | |
return false | |
end | |
arr_s = [a,b,c].sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------------------------------------------ | |
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here. | |
//------------------------------------------------------------------------------------------------------------------ | |
//------------------------------------------------------------------------------------------------------------------ | |
// DRIVER CODE: Do **NOT** change anything below this point. Your task is to implement code above to make this work. | |
//------------------------------------------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// shorthand for $(document).ready(); | |
$(function(){ | |
$("form[name='sign_up']").submit(validatePassword); | |
}); | |
function validateEmail(){ | |
var email = $("[name='email']").val() | |
var email_validate = /\w+\@.+\.\w{2,}/ | |
if (email_validate.test(email) == false ){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shorthand for $(document).ready(); | |
$(function(){ | |
$("#next_frame").click(nextSlide) | |
$("#previous_frame").click(prevSlide) | |
}); | |
function nextSlide(){ | |
$('.frames').animate({ | |
"left": "-=360px"}, | |
"slow"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# to run script use command 'ruby file_watch.rb path/to/directory' | |
filetypes = ['css', 'html', 'php', 'rb', 'erb', 'scss', 'js'] | |
watch_folder = ARGV[0] | |
puts "Watching #{watch_folder} and subfolders for changes in project files..." | |
while true do | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// declares global variables | |
var newEntry = document.getElementById('newEntry'),total = 0, | |
printedTotal = document.getElementById('total'), | |
entryBody = document.getElementById('entries'); | |
// listen for event on the 'entry' form | |
// calls function executeCashRegister | |
document.getElementById('entry').addEventListener('submit', executeCashRegister) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_change(num, change = {pennies: 0, nickels: 0, dimes: 0, quarters: 0}) | |
return change if num == 0 | |
if num < 5 | |
num.times do |penny| | |
change[:pennies] += 1 | |
num -= 1 | |
end | |
make_change(num, change) |
OlderNewer