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
function corSPLIT(input) { | |
function splitValue(value, index) { | |
//console.log(value.substring(0, index+1) + "#" + value.substring(index+1)); | |
return value.substring(0, index+1) + "#" + value.substring(index+1); | |
} | |
var corNumA = input.split(""); | |
//console.log(corNumA); |
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
# http://www.rubeque.com/problems/reverse-each-word | |
# http://ruby-doc.org/core-2.0/Enumerable.html#method-i-inject | |
# After some refactoring both these methods work! | |
# Both use Enumerable#inject; however, the first removes the unecessary ' ' at the end of the string | |
# using string substitution, while the second uses a conditional to prevent the space from ever being added | |
def reverse_each_word(sentence) |
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 () { | |
$('#blogs').hover( | |
function () { | |
//show its submenu | |
$('ul', this).stop().slideDown(400); | |
}, | |
function () { | |
//hide its submenu | |
$('ul', this).stop().slideUp(200); | |
} |
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 separate_comma(number) | |
number.to_s.gsub(/(\d)(?=(\d{3})+$)/, '\1,') | |
end |
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
class Account | |
attr_reader :name | |
attr_reader :balance | |
def initialize(name, balance = 100) | |
@name = name | |
@balance = balance | |
end |
NewerOlder