Skip to content

Instantly share code, notes, and snippets.

@ryanvgates
ryanvgates / gist:0c7ffde58a28933399d8
Created December 10, 2014 18:37
if statement with single quotes
var fruit = 'orange';
if (fruit.length > 5) {
console.log('The fruit name has more than five characters.');
} else {
console.log('The fruit name has five characters or less.');
}
@ryanvgates
ryanvgates / index.js
Created May 12, 2015 02:53
Step 1 - Adding a Title
g = new Dygraph(
// containing div
document.getElementById("graphdiv"),
// CSV or path to a CSV file.
"Fort Lauderdale Data Snapshot-Reoriented.csv",
{
title: 'Fort Lauderdale Budget Data'
}
@ryanvgates
ryanvgates / index.js
Created May 12, 2015 02:57
Step 0 - Plain Jane
g = new Dygraph(
// containing div
document.getElementById("graphdiv"),
// CSV or path to a CSV file.
"Fort Lauderdale Data Snapshot-Reoriented.csv"
);
@ryanvgates
ryanvgates / index.js
Created May 12, 2015 03:16
Step 2 - Resize
g = new Dygraph(
// containing div
document.getElementById("graphdiv"),
// CSV or path to a CSV file.
"Fort Lauderdale Data Snapshot-Reoriented.csv",
{
title: 'Fort Lauderdale Budget Data',
width: 800,
@ryanvgates
ryanvgates / index.js
Created May 12, 2015 03:35
Step 3 - Formatting Currency
g = new Dygraph(
// containing div
document.getElementById("graphdiv"),
// CSV or path to a CSV file.
"Fort Lauderdale Data Snapshot-Reoriented.csv",
{
title: 'Fort Lauderdale Budget Data',
width: 800,
@ryanvgates
ryanvgates / index.js
Created May 13, 2015 04:33
Step 4 - Set Axis Label Width
g = new Dygraph(
// containing div
document.getElementById("graphdiv"),
// CSV or path to a CSV file.
"Fort Lauderdale Data Snapshot-Reoriented.csv",
{
title: 'Fort Lauderdale Budget Data',
width: 800,
@ryanvgates
ryanvgates / index.js
Created May 14, 2015 02:09
Step 5 - Refactor
g = new Dygraph(
// containing div
document.getElementById("graphdiv"),
// CSV or path to a CSV file.
"Fort Lauderdale Data Snapshot-Reoriented.csv",
{
title: 'Fort Lauderdale Budget Data',
width: 800,
@ryanvgates
ryanvgates / index.js
Created May 14, 2015 02:16
Step 6 - Debugging Tip
g = new Dygraph(
// containing div
document.getElementById("graphdiv"),
// CSV or path to a CSV file.
"Fort Lauderdale Data Snapshot-Reoriented.csv",
{
title: 'Fort Lauderdale Budget Data',
width: 800,
@ryanvgates
ryanvgates / index.css
Last active August 29, 2015 14:21
Step 7 - Styling
#graphdivlegend {
float: right;
}
#graphdiv {
float: left;
}
#graphdivlegend > span {
display: block;
@ryanvgates
ryanvgates / stackTrace
Created May 28, 2015 22:20
Commerce Server - COMException: Authentication Failed
[COMException (0x80040e4d): Authentication failed.]
Microsoft.CommerceServer.Interop.Profiles.ProfileServiceClass.GetProfileByKey(String bstrKeyMemberName, Object sValue, String bstrType, Boolean bReturnError) +0
Microsoft.CommerceServer.Runtime.Profiles.Profile..ctor(ProfileContext profileService, String keyName, String keyValue, String profileType) +156
[CommerceProfileSystemException: Failed to retrieve profile.]
Microsoft.CommerceServer.Runtime.Profiles.Profile..ctor(ProfileContext profileService, String keyName, String keyValue, String profileType) +504
Microsoft.CommerceServer.Runtime.Profiles.ProfileContext.GetProfile(String keyName, String keyValue, String profileType) +647
Microsoft.CommerceServer.Runtime.CommerceContext.get_UserID() +744