Posted On: July 26th, 2011
Object Literals:
JavaScript is mostly composed of objects. You should use objects to collect and store common data and information:
var person = {
firstName: "john",
lastName: "doe",
address: {
street: "321 Street",
zipCode: "94125",
county: "San Francisco",
state: "CA"
}
};
An empty JavaScript object, is defined, like so:
var person = { };
CONTINUE READING
COMMENT (1)
Posted On: May 31st, 2011
http://paceyourself.net Managing client side javascript with require.js
CONTINUE READING
Comments Off
Posted On: September 23rd, 2010
I went around the internet looking for a quick tutorial setting up DotNetOpenAuth for a project. No big surprise everything I ran into was either too confusing to follow or filled with useless information.
If you need to get your ASP.NET MVC website setup with some basic OpenID Authentication, I can help get you started. All you need is a DLL, a view, and two controller actions.
First download the latest DotNetOpenAuth and extract the zip file. Let’s start.
CONTINUE READING
COMMENTS (7)
DotNetOpenAuth, openID asp.net, OpenID for ASP.NET MVC A Quick Setup, openID MVC
Posted On: September 10th, 2010

If you are like me you have tried every testing methodology in the book. Half way through it usually became a crutch, you couldn’t figure out why or how to use it to your advantage. Being an avid reader of Dan North’s blog, a while back I ran into the concept of Behavior-Driven Development.
Testing always felt like a bad symptom to me and it got boring quickly. I felt like I was writing tests to prevent others from changing my code. Frankly it was just silly.
Sound familiar?
CONTINUE READING
COMMENT (1)
BDD, BDD .NET, BDD SpecFlow, BDD SpecFlow .NET, Behavior-Driven Development, Behavior-Driven Development SpecFlow, SpecFlow
Posted On: August 30th, 2010
By now you are probably a big fan of Zen Coding, and want more. I am going to run through a tutorial on how to create custom snippets using the “Zen Coding.js” file.
At the end of this tutorial I have a link to a PHP version I wrote for personal use, feel free to download, edit, destroy, and share it.
Lets dive in.
CONTINUE READING
COMMENTS (10)
add custom zen coding tags, customize zen coding, make zen coding abbreviations, zen coding php, zen coding snippets, zen coding snippets & php, zen coding snippets and php, Zencoding PHP, zencoding snippets
Posted On: January 1st, 2010
Microsoft, has officially re-released a self aware Dell Hardware destroying Virus in Visual Studio 2010. This virus will effect your computer if you start running Unit Tests, it is currently masquerading around as what appears to be a QuickTimeAgent32 process, to divert the blame on Apple.
Over time it will slowly make your hardware less functional and will make you want to crawl under your desk, or go after your computer with a baseball bat.
The current fix is to not run Unit Tests, or if you really have to, you can use ReSharper:
ReSharper -> Unit Tests -> Run All Tests from Solution.
Yes, this is a joke, well the virus part anyway!
CONTINUE READING
COMMENT (1)
Dell Computer Slow, Humor, QTAgent32.exe, QTAgent32.exe Solution, Virus, Visual Studio 2010, VS 2010 QTAgent32, VS10 QTAgent32
Posted On: December 1st, 2009
If your reading this then I assume you are either looking for or have an interest in a mocking framework for testing your .NET Applications.
In this tutorial I will step you through a framework called Moq for (.NET) released under the New BSD License. I will not be discussing what Mocking is here as that’s outside the scope of this tutorial. What is mocking/mock object?
Before we jump in to the code, here are some important links:
Get Moq.
Get Moq Contrib
Moq API.
So lets dive in, assuming you already added a reference to the Moq DLL and Moq.Contrib DLL in your project. Let’s start out by creating a new Abstract class to your project. During this session I am going to call this class: UnitBaseAbstractClass for readability.
CONTINUE READING
COMMENTS (15)
.NET, C#, Mock Objects, Mock q, Mocking, Moq, Testing
Posted On: September 17th, 2009
I wrote a quick little extension for Visual Studio 2010, which allows you to View SCSS with CSS 2.1 Syntax Highlighting and Intellisense, not the greatest thing in the world, but it helps a bit.
It can easily be uninstalled through the Extension Manager, if you don’t want it anymore. I basically took the values in my Registry for Css and duplicated them for SCSS.
Extension Source:
[$RootKey$\Languages\File Extensions\.scss]
@="{A764E898-518D-11d2-9A89-00C04F79EFC3}"
[$RootKey$\Editors\{A764E89A-518D-11d2-9A89-00C04F79EFC3}\Extensions]
"scss"=dword:00000040
READ BEFORE INSTALL!:
- You must “Exclude [files] from Project” [SCSS] after install, then “View hidden files” and “Include files in Project” to make this work on existing files.
- Run the installer as an Administrator.
- Remove any entries for “scss” from: Tools, Text Editor, File Extension.
Download Extension: ScssInCss
CONTINUE READING
COMMENTS (15)
Posted On: April 1st, 2009
I couldn’t find a simple example of reading a WordPress Blog Feed in C# and caching it. So I decided to write out my own.
Here is an example to get you started. I wrote it in two parts:
A Class that Consumes a Feed (FeedReader)
An Object representing a Feed Item (FeedViewModel).
And so we begin:
CONTINUE READING
COMMENTS (4)
C#, how do I load an rss feed in c#, load rssfeed C#, rss feed C#, rssfeed in c#, wordpress feed, wordpress rss feed in c#
Posted On: March 1st, 2009
If you are like me then you have probably ran into a wall with using ASP.NET MVC View Engine to render your awesome Dynamic HTML Email Templates. At least you put up a fight using a lot of fake data. It is actually possible to get around it!
var oldContext = HttpContext.Current;
HttpContext.Current = new HttpContext(HttpContext.Current.Request,
fakeResponse);
var html = new HtmlHelper(new ViewContext(fakeControllerContext,
new FakeView(), fakeViewDataDictionary, new TempDataDictionary()),
new ViewPage());
html.RenderPartial(viewName, viewData, viewDataDictionary);
HttpContext.Current = oldContext; //yay
Though, because you’re reading this you’re like me and you never give up! So how, how do you get around all of this? The answer is Spark. Eeek, another DLL? Yes, Spark is its own View Engine which is an entire different framework. Yes, you have to go to their website download the DLLS, put it in your Lib folder and reference it in your code. Let me tell you now, it is well worth it. Let’s dive in!
Let’s write the code to render our email using the Spark. We want our code to take in the template name, something like: “ForgotUsernameEmail.spark” and we also want it to reuse our current ViewData Object which is of type ViewDataDictionary and contains Person data, we will need to add this into our own implementation of AbstractSparkView. See samples bellow:
CONTINUE READING
COMMENTS (7)
ASP Email, ASP.NET EMAIL Templates, ASP.NET MVC, C#, Email, email template engine, EmailTemplates, MVC Email, Spark, Spark Email, spark template engine, Spark View Engine
Want to read more? Check out my Archive.