Skip to content

Instantly share code, notes, and snippets.

View jpetto's full-sized avatar
🪐

J Petto jpetto

🪐
View GitHub Profile
@jpetto
jpetto / old_to_new_school.html
Last active December 11, 2015 22:18
Old school markup & CSS. Convert it to use HTML5 elements & CSS class selectors. Also, finish up the JavaScript.
<!DOCTYPE html>
<html>
<head>
<title>Mmm, Tasty!</title>
<link href='http://fonts.googleapis.com/css?family=Wendy+One|Pontano+Sans' rel='stylesheet' type='text/css'>
<style type="text/css">
html { font-size: 62.5%; }
@jpetto
jpetto / gist:4660273
Created January 28, 2013 23:29
Tip calculator - pseudo code exercise.
string str_service_type = "good";
double dbl_tip_percentage = 0;
double dbl_food_total = 24.55;
double dbl_tip;
if (str_service_type == "good") {
dbl_tip_percentage = .15;
} else if (str_service_type == "great") {
dbl_tip_percentage = .2;
} else {
@jpetto
jpetto / registerinvitation.php
Created November 7, 2012 19:55
patch for Bootstrap 0.9 Vanilla Forum theme
<?php if (!defined('APPLICATION')) exit(); ?>
<div class="Entry">
<?php
$TermsOfServiceUrl = Gdn::Config('Garden.TermsOfService', '#');
$TermsOfServiceText = sprintf(T('I agree to the <a id="TermsOfService" class="Popup" target="terms" href="%s">terms of service</a>'), Url($TermsOfServiceUrl));
// Make sure to force this form to post to the correct place in case the view is
// rendered within another view (ie. /dashboard/entry/index/):
echo $this->Form->Open(array('Action' => Url('/entry/register'), 'id' => 'Form_User_Register', 'class' => 'form-horizontal'));
echo $this->Form->Errors();
@jpetto
jpetto / gist:4021732
Created November 6, 2012 01:00
Light Show
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Light Show</title>
<style type="text/css">
.cell {
width: 100px;
float: left;
@jpetto
jpetto / jquery_event_delegation_demo.html
Created November 5, 2012 19:51
jQuery Event Delegation
<!DOCTYPE html>
<html>
<head>
<title>Nav Delegation</title>
<style type="text/css">
#member-error {
background: #c44a17;
padding: 10px;
color: #fff;
@jpetto
jpetto / gist:3939613
Created October 23, 2012 15:53
Intro to JS - Quiz 1 (Alternate)
<!DOCTYPE html>
<html>
<head>
<title>Intro to JavaScript - Quiz #1 - Alternate</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;
}
@jpetto
jpetto / gist:3903207
Created October 17, 2012 01:21
Whack-a-mole - FANCY
<!DOCTYPE html>
<html>
<head>
<title>Whack-A-Fighter II</title>
<style type="text/css">
#left { float: left; }
#field {
width: 500px;
@jpetto
jpetto / gist:3903204
Created October 17, 2012 01:21
Whack-a-mole - BASIC
<!DOCTYPE html>
<html>
<head>
<title>Whack-a-mole</title>
<style type="text/css">
#field {
float: left;
width: 500px;
height: 500px;
@jpetto
jpetto / gist:3903200
Created October 17, 2012 01:19
Intro to JS - Quiz #1 Solution
<!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;
}
@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;
}