Skip to content

Instantly share code, notes, and snippets.

Matt Jennings Hollyw00d

Block or report user

Report or block Hollyw00d

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Hollyw00d
Hollyw00d / plant_catalog.xml
Last active May 11, 2018
Example XML Code
View plant_catalog.xml
<CATALOG>
<PLANT>
<COMMON>Bloodroot</COMMON>
<BOTANICAL>Sanguinaria canadensis</BOTANICAL>
<ZONE>4</ZONE>
<LIGHT>Mostly Shady</LIGHT>
<PRICE>$2.44</PRICE>
<AVAILABILITY>031599</AVAILABILITY>
</PLANT>
<PLANT>
View Random.cshtml
@model ViewBag.Title = "Random";
@{
ViewBag.Title = "Random";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>@Model.Name</h2>
View script.js
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript" scr="script.js"></script>
</head>
<body>
<p>Click to hide.</p>
</body>
</html>
@Hollyw00d
Hollyw00d / gist:2f440879e51913bed740
Created Aug 18, 2014
Object Scope Help and [return] Keyword Definition Needed
View gist:2f440879e51913bed740
// From "Passing Objects into Functions" > 28/33 > Objects I > CodeAcademy.com
// QUESTIONS:
// 1. Per line 17, I understand that the I am passing the [ageDifference] object's properties as parameters into the [Person] constructor. Does an object always have access to an object constructor's properties when the [this] keyword is used, along with the object using the same properties as the object constructor?
// 2. Per line 17, what does the [return] keyword do? When should the [return] be used?
function Person (name, age) {
this.name = name;
@Hollyw00d
Hollyw00d / gist:0f8f8c87119761075565
Last active Aug 29, 2015
Object Method Clarification Needed
View gist:0f8f8c87119761075565
// From "Constructors with Methods" > 24/33 > Objects I > CodeAcademy.com
// QUESTIONS:
// 1. In line 19, why does the [rex] property, which is assigned to the [area] object, get a [calcArea] value? Or is it called a [calcArea] method of the [rex] property?
function Rectangle(height, width) {
this.height = height;
this.width = width;
this.calcArea = function() {
View gist:38c18fe83df7257d5044
/*
See "Hoisting Section" on:
http://dailyjs.com/2012/07/23/js101-scope/
*/
/*
**QUESTION**
Why does Code 1 evaluate to "undefined" and Code 2 evaulate to "1".
I thought both codes would evaluate to "1" because of hoisting.
*/
@Hollyw00d
Hollyw00d / gist:d558e572e81424c4bfde
Last active Aug 29, 2015
Assign Function to Variable or Not
View gist:d558e572e81424c4bfde
// Code 1
var doStuff = function() {
// More code here
};
// Code 2
function doStuff() {
// More code here
}
You can’t perform that action at this time.