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
for(var i = 0; i <= 20; i++) { | |
if( i % 3 === 0 && i % 5 === 0 ) { | |
console.log( "FizzBuzz" ); | |
} else if( i % 3 === 0 ) { | |
console.log( "Fizz" ); | |
} else if( i % 5 === 0 ) { | |
console.log( "Buzz" ); | |
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 astro(this_is_a_variable) | |
puts "#{this_is_a_variable} is a lucky number." | |
end | |
astro = 20 |
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 astro(this_is_a_variable) | |
puts "#{this_is_a_variable} is a lucky number." | |
end | |
astro = 20 | |
puts this_is_a_variable |
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
puts "Hey Girl!" |
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 meth(a, b) | |
puts a + b | |
end | |
meth(3, 2) |
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() { | |
$('#reverse').click(function() { | |
var comment = $('#input').val(); | |
var rev_str = comment.split('').reverse().join(''); | |
alert(rev_str); | |
}); | |
}); | |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Reverse</title> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
<style id="jsbin-css"> | |
* { | |
margin: 0; | |
padding: 0; |
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
array = (1..10).to_a | |
container = [] | |
array.each do |x| | |
container << x if x.odd? | |
end | |
container[3] |
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
flatiron_school = {:teachers=>[{:name=>"steph"}, {:name=>"uzo"}, {:name=>"blake"}], :students => [{:name => "giancarlo", :grade => 100, :address => "bronx"},{:name => "jamie", :grade => 200, :address => "NJ"}]} | |
flatiron_school.each do |key, value| | |
value.each do |names| | |
puts names[:name] | |
end | |
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
sentence = <<-something | |
Steven likes the movies. Blake likes to ride his bike but hates movies. | |
Blake is taller than steven. Steven is a great teacher. | |
something | |
sentence = sentence.gsub(".", " ") #sub period for space | |
sentence = sentence.split(" ") | |
[] << sentence | |
sentence.detect {|x| sentence.count(x) > 1} |
OlderNewer