Skip to content

Instantly share code, notes, and snippets.

@Omrika
Omrika / FizzBuzz
Last active August 29, 2015 14:09
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" );
def astro(this_is_a_variable)
puts "#{this_is_a_variable} is a lucky number."
end
astro = 20
def astro(this_is_a_variable)
puts "#{this_is_a_variable} is a lucky number."
end
astro = 20
puts this_is_a_variable
puts "Hey Girl!"
def meth(a, b)
puts a + b
end
meth(3, 2)
$(document).ready(function() {
$('#reverse').click(function() {
var comment = $('#input').val();
var rev_str = comment.split('').reverse().join('');
alert(rev_str);
});
});
<!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;
array = (1..10).to_a
container = []
array.each do |x|
container << x if x.odd?
end
container[3]
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
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}