Skip to content

Instantly share code, notes, and snippets.

View jpetto's full-sized avatar
🪐

J Petto jpetto

🪐
View GitHub Profile
@jpetto
jpetto / 0_reuse_code.js
Created March 5, 2014 23:00
Here are some things you can do with Gists in GistBox. Clutter!
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jpetto
jpetto / gist:9124867
Created February 20, 2014 22:45
CW: Theme Switcher - starter JS
;(function($) {
'use strict';
var $body = $('body');
var $theme_list = $('#theme-list');
var $theme_bar = $('#theme-bar');
var themes = ['risky', 'rooftop', 'specter'];
var current_theme = themes[0];
@jpetto
jpetto / index.html
Last active August 29, 2015 13:56
ASWM: HW - Jokes starter
<!DOCTYPE html>
<html>
<head>
<title>Jokes...jokes</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.4.2/base-min.css">
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.4.2/buttons-min.css">
<style type="text/css">
html, body {
background: #ccc;
@jpetto
jpetto / gist:8928835
Created February 11, 2014 03:30
ASWM - HW 1 - Helper code
;(function() {
'use strict';
// get a reference to the element with the id 'mountain-image'
var mountain_image = document.querySelector('#mountain-image');
// get a reference to the element with the id 'mountain'
// TODO 1
// add a click event listener to the mountain_image element
@jpetto
jpetto / banner-builder.html
Created January 30, 2014 15:59
ASWM - Banner Builder starter template
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Review - Banner Builder</title>
<link href='http://fonts.googleapis.com/css?family=Cutive' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="http://cdnjs.cloudflare.com/ajax/libs/pure/0.3.0/pure-min.css">
<style type="text/css">
.pure-form input[type="color"] {
padding: 0.2em 0.3em;
@jpetto
jpetto / awsm.html
Created January 29, 2014 21:57
ASWM - HTML starter template
<!DOCTYPE html>
<html>
<head>
<title>ASWM - Starter Template</title>
<!-- stylesheets here -->
</head>
<body>
<!-- javascripts go here -->
@jpetto
jpetto / gist:8061109
Created December 20, 2013 20:36
Mozilla.org Pre-PR Questionnaire

Mozilla.org Pre-PR Questionnaire

  1. Did you set up a /b/ redirect and any other necessary rewrite rules?

  2. Did you let L10n know about all string changes?

  3. Did you optimize all images?

  4. Did you test with JavaScript disabled?

@jpetto
jpetto / alt-hitcallback-fix.js
Created December 2, 2013 22:38
Alternate hitCallback fix.
function gaTrack(eventArray, callback) {
// submit eventArray to GA and call callback only after tracking has
// been sent, or if sending fails.
//
// callback is optional.
//
// Example usage:
//
// $(function() {
// var handler = function(e) {
@jpetto
jpetto / cw-ajax.html
Last active December 29, 2015 09:59
EWT CW: AJAX - NES Games
<!DOCTYPE html>
<html>
<head>
<title>NES!</title>
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<style type="text/css">
/* Eric Meyer's Reset CSS v2.0 - http://cssreset.com */
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
@jpetto
jpetto / animation-demo.html
Last active December 27, 2015 12:29
EWT - Animation demo
<!doctype html>
<html>
<head>
<title>CSS Animations - Percentages</title>
<style type="text/css">
#doit {
display: block;
margin: 0 auto;
}