Skip to content

Instantly share code, notes, and snippets.

View StephenFiser's full-sized avatar

Stephen Fiser StephenFiser

View GitHub Profile
$(document).ready(function() {
$('#new-to-do-item').keyup(function() {
alert("key pressed");
});
});
$(document).ready(function() {
$('h3').click(function() {
$(this).text("ehh... Maybe tomorrow");
});
});
$(document).ready(function() {
alert("it's working!");
});
<!doctype html>
<html>
<head>
<title>Hello!</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="./my_stuff.js"></script>
</head>
<body>
<h1>Hello World!</h1>
<div>
<!doctype html>
<html>
<head>
<title>Hello!</title>
</head>
<body>
<h1>Hello World!</h1>
<div>
<h3 data-stuff="to dos">Things I would like to do today:</h3>
<input type="text" id="new-to-do-item" placeholder="Enter a new todo item...">
require 'open-uri'
print "Enter a website domain you like (without the http://): "
website = gets.chomp
if website.count(".") >= 2
first_letter = website.index(".") + 1 # we want the letter just after the first dot
after_first_letter = first_letter + 1
last_letter = (website.index(".", after_first_letter) - 1)
website_title = website[first_letter..last_letter]
elsif website.count(".") == 1
p "Enter a number: "
first = gets.chomp.to_i
p "Enter a second number: "
second = gets.chomp.to_i
def multiply(num1, num2)
num1 * num2
end
p "Enter your favorite number: "
number = gets.chomp
p "The number you entered was #{number}"
class Report < ActiveRecord::Base
attr_accessible :title
belongs_to :presenter
delegate :team_name, to: :presenter, prefix: true
end