Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@Hollyw00d
Hollyw00d / events-agenda-page-code-sample.txt
Last active May 10, 2020 02:47
ESJS Events Agenda Page Code Sample
<!-- HTML -->
<a href="#" id="link">My Kewl Link</a>
/* CSS */
#link {
color: green;
text-decoration: none;
}
.active-blue {
@Hollyw00d
Hollyw00d / plant_catalog.xml
Last active May 11, 2018 22:35
Example XML Code
<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>
@Hollyw00d
Hollyw00d / Random.cshtml
Created May 11, 2018 20:18
Razor Example
@model ViewBag.Title = "Random";
@{
ViewBag.Title = "Random";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<h2>@Model.Name</h2>
<!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:0f8f8c87119761075565
Last active August 29, 2015 14:05
Object Method Clarification Needed
// 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() {
@Hollyw00d
Hollyw00d / gist:2f440879e51913bed740
Created August 18, 2014 17:15
Object Scope Help and [return] Keyword Definition Needed
// 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:38c18fe83df7257d5044
Created August 13, 2014 22:03
Hoisting Clarity Needed
/*
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 August 29, 2015 14:05
Assign Function to Variable or Not
// Code 1
var doStuff = function() {
// More code here
};
// Code 2
function doStuff() {
// More code here
}