Skip to content

Instantly share code, notes, and snippets.

View jpetto's full-sized avatar
🪐

J Petto jpetto

🪐
View GitHub Profile
@jpetto
jpetto / dom_demo_whack_a_mole.html
Created August 31, 2012 17:04
DOM Demo - Whack-a-mole
<!DOCTYPE html>
<html>
<head>
<title>Whack-a-mole</title>
<style type="text/css">
#field {
width: 500px;
height: 500px;
position: relative;
@jpetto
jpetto / javascript_this_1.js
Created August 31, 2012 22:40
JavaScript this demo #1
var user = {
greet: function() {
// this refers to the calling object - user
console.log("Hello there " + this.name + "!");
}
};
var name;
var get_name = function() {
@jpetto
jpetto / gist:3703453
Created September 12, 2012 01:14
Week 2 DOM Stuff
<!DOCTYPE html>
<html>
<head>
<title>Week 2!</title>
<style type="text/css">
#main {
padding: 10px;
background: #FFC4DC;
}
@jpetto
jpetto / gist:3703712
Created September 12, 2012 01:58
Week 2 Classwork Helper
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<form id="racer_form">
<input type="text" name="alphabet" id="alphabet" />
<button type="button" id="start">Start Typing!</button>
@jpetto
jpetto / gist:3745142
Created September 18, 2012 19:09
Adding Machine
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplicationAddingMachine
{
class Program
{
static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplicationQuiz1
{
class Program
{
static void Main(string[] args)
@jpetto
jpetto / gist:3747281
Created September 19, 2012 02:22
Keyboard Racer - Evolved
<!DOCTYPE html>
<html>
<head>
<title>Keyboard Racer :*Evolved*:</title>
</head>
<body>
<p>
Enter your name in the box below. When you're ready to play, click the
<em>Start Typing!</em> button and type the alphabet.
// ask the user for a number grade
Console.WriteLine("Hey, what grade did you get on that test?");
// declare variable to hold number grade
int intGrade = -1;
try
{
// assign grade number from user
intGrade = int.Parse(Console.ReadLine());
@jpetto
jpetto / gist:3785612
Created September 26, 2012 02:16
Week 4 Classwork Helper
<!DOCTYPE html>
<html>
<head>
<title>Random Quiz!</title>
<style type="text/css">
.wrong {
border: 2px solid #f00;
}
@jpetto
jpetto / gist:3862325
Created October 10, 2012 00:12
Intro to JS - Quiz 1
<!DOCTYPE html>
<html>
<head>
<title>Intro to JavaScript - Quiz #1</title>
<link rel="stylesheet" type="text/css" href="http://necolas.github.com/normalize.css/2.0.1/normalize.css">
<style type="text/css">
html, body {
background: #6dbadc;
}