Skip to content

Instantly share code, notes, and snippets.

View StephenFiser's full-sized avatar

Stephen Fiser StephenFiser

View GitHub Profile
class Dog
def bark
"Ruff"
end
def walk
"walking..."
end
$(document).ready(function() {
listenForChecks();
// Event Listeners
$('#new-to-do-item').keyup(function(e) {
if (e.which === 13) {
var text = $(this).val();
var listItem = "<li><input type='checkbox'>" + text + "</li>"
<!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>
$(document).ready(function() {
$('#new-to-do-item').keyup(function(e) {
if (e.which === 13) {
var text = $(this).val();
var listItem = "<li><input type='checkbox'>" + text + "</li>"
$('ul').append(listItem);
}
});
$('input[type="checkbox"]').click(function() {
console.log(this);
p "Enter a number: "
num1 = gets.chomp.to_i
p "Enter an exponent: "
num2 = gets.chomp.to_i
def exponent(number, exp)
number ** exp
end
p "Enter a number: "
num1 = gets.chomp.to_i
p "Enter an exponent: "
num2 = gets.chomp.to_i
def exponent(number, exp)
answer = number
if exp == 0
answer = 1
require 'open-uri'
print "Enter a website domain you like (without the http://): "
website = gets.chomp
begin
file = open("http://#{website}")
contents = file.read
unless contents.index("<h1>").nil?
header_start = contents.index("<h1>") + 4
$(document).ready(function() {
$('#new-to-do-item').keyup(function(e) {
if (e.which === 13) {
var text = $(this).val();
var listItem = "<li><input type='checkbox'>" + text + "</li>"
$('ul').append(listItem);
}
});
});
$(document).ready(function() {
$('#new-to-do-item').keyup(function(e) {
if (e.which === 13) {
var text = $(this).val();
alert(text);
}
});
});
$(document).ready(function() {
$('#new-to-do-item').keyup(function(e) {
alert(e.which);
});
});