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 get_grade(array) | |
average = array.inject(:+).to_f / array.length | |
case average | |
when 0..59 | |
"F" | |
when 60..69 | |
"D" | |
when 70..79 | |
"C" |
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
// pseudo for u1_w2_c5.js | |
// | |
// write 3 functions to calculate the sum, mean and median of even and odd arrays | |
// create variable total and set equal to 0 | |
// | |
// Sum | |
// create a function sum, that takes a single input as an argument. | |
// |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
var player = { | |
name: "Eddie Murphy", | |
}; | |
var ogre = { |
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 north_korean_cipher(coded_sentence) | |
input = coded_sentence.downcase.split("") # takes the input and splits each letter into its own string. Check out this method in IRB to see how it works! Also refer to the ruby docs. | |
decoded_sentence = [] #blank array | |
cipher = {"e" => "a", # This is technically a shift of four letters...Can you think of a way to automate this? Is a hash | |
"f" => "b", # the best data structure for this problem? What are the pros and cons of hashes? | |
"g" => "c", | |
"h" => "d", | |
"i" => "e", | |
"j" => "f", | |
"k" => "g", |
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
# ORIGINAL CODE (NOT ALTERED) | |
# def to_roman(num) | |
# roman_values = { 'M'=>1000, | |
# 'D'=>500, | |
# 'C'=>100, | |
# 'L'=>50, | |
# 'X'=>10, | |
# 'V'=>5, | |
# 'I'=>1} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#################################### | |
#################################### | |
#################################### | |
####### METAGAME ########### | |
####### SCHEMAS ########### | |
####### ########### | |
####### Contributors ########### | |
####### ########### | |
####### BootCoder ########### | |
####### MisterDamon ########### |
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
var handleBarListener = function() { | |
$(".ajax-private-profile-button").on("ajax:success", function(event, data, status, xhr){ | |
console.log("INSIDE ajax-private-profile-button"); | |
console.log(data); | |
$(".old-profile").fadeOut("slow"); | |
setTimeout(function(){$(".private-profile-handlebars").fadeIn();}, 1000); | |
var templateIndexSource = $(".private-profile-template").html(); | |
// debugger; | |
// console.log(templateIndexSource); |
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
$(document).ready(function() { | |
// This is called after the document has loaded in its entirety | |
// This guarantees that any elements we bind to will exist on the page | |
// when we try to bind to them | |
// See: http://docs.jquery.com/Tutorials:Introducing_$(document).ready() | |
Person = function(attribute){ | |
this.attributes = attributes | |
} |
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
$(document).ready(function() { | |
// This is called after the document has loaded in its entirety | |
// This guarantees that any elements we bind to will exist on the page | |
// when we try to bind to them | |
// See: http://docs.jquery.com/Tutorials:Introducing_$(document).ready() | |
Person = function(attribute){ | |
this.attributes = attributes | |
} |
OlderNewer