Skip to content

Instantly share code, notes, and snippets.

View jorydotcom's full-sized avatar
💫
here to help

Jory Burson jorydotcom

💫
here to help
View GitHub Profile
@jorydotcom
jorydotcom / gist:2865606
Created June 4, 2012 00:25
JS Pogs player object
//Player object with number and total of Pogs properties
var Player = function() {
this.name = prompt("What is your name?");
this.totalPogs = 25;
this.numPogs = 0;
while (this.numPogs > this.totalPogs || this.numPogs <= 0) {
this.numPogs = parseInt(prompt("How many pogs would you like to play with, " + this.name + "? Pick a number between 0 and " + this.totalPogs + "."), 10);
}
};
@jorydotcom
jorydotcom / gist:2865615
Created June 4, 2012 00:29
JS Pogs Version 1
//Player object with number and total of Pogs properties
var Player = function() {
this.name = prompt("What is your name?");
this.totalPogs = 25;
this.numPogs = 0;
while (this.numPogs > this.totalPogs || this.numPogs <= 0) {
this.numPogs = parseInt(prompt("How many pogs would you like to play with, " + this.name + "? Pick a number between 0 and " + this.totalPogs + "."), 10);
}
};
//Creates player 1
@jorydotcom
jorydotcom / gist:2865654
Created June 4, 2012 00:43
Pogs Object
//Pogs object
var Pogs = function() {
this.gameSet = player1.numPogs + player2.numPogs;
};
@jorydotcom
jorydotcom / gist:2865678
Created June 4, 2012 00:52
Updating Pog Count
//Updates player pog totals to initialize game
var updatePogCount = function(player) {
player.totalPogs = player.totalPogs - player.numPogs;
return player.totalPogs;
};
// Add an else statement in case the number is divisible by 5.
// for the numbers 1 through 20,
for (i=1; i<=20; i++) {
if ( i % 3 === 0 ) {
if (i % 5 === 0) {
console.log("FizzBuzz");
} else {
console.log("Fizz");
}
@jorydotcom
jorydotcom / gist:2956269
Created June 19, 2012 20:12
Bocoup jQuery Training - pre-class set-up requirements

Bocoup jQuery Training

Pre-class setup

Before you arrive for the class, you must do the following:

Install Node.js

If you already have Node.js version v0.6.0 or higher (you can check this by running node --version at the command line), you can skip this step.

@jorydotcom
jorydotcom / problem2.js
Created August 4, 2012 02:01
My answers to @rmurphey's Assessment problems
//Also from https://gist.github.com/3164584
//My first attempt to solve Problem 2:
function watWord(num) {
switch (num) {
case 1:
return "one";
case 2:
return "two";
case 3:
return "three";
@jorydotcom
jorydotcom / problems.js
Created August 4, 2012 02:44
@rmurphey's Assessment problems: Problem 2
function watWord(num) {
switch (num) {
case 1:
return "one";
case 2:
return "two";
case 3:
return "three";
case 4:
return "four";
function Egg (type, grade, shape, color, size, count) {
this.type = type,
this.grade = grade;
this.shape = shape;
this.color = color;
this.size = size;
}
<div style="width:100%; text-align:left;" ><iframe src="http://www.eventbrite.com/tickets-external?eid=6064877211&ref=etckt&v=2" frameborder="0" height="317" width="100%" vspace="0" hspace="0" marginheight="5" marginwidth="5" scrolling="auto" allowtransparency="true"></iframe><div style="font-family:Helvetica, Arial; font-size:10px; padding:5px 0 5px; margin:2px; width:100%; text-align:left;" ><a style="color:#ddd; text-decoration:none;" target="_blank" href="http://www.eventbrite.com/r/etckt">Online event registration</a><span style="color:#ddd;"> for </span><a style="color:#ddd; text-decoration:none;" target="_blank" href="http://www.eventbrite.com/event/6064877211?ref=etckt">TXJS JavaScript Best Practices Training</a> <span style="color:#ddd;">powered by</span> <a style="color:#ddd; text-decoration:none;" target="_blank" href="http://www.eventbrite.com?ref=etckt">Eventbrite</a></div></div>