Skip to content

Instantly share code, notes, and snippets.

View keithelliott's full-sized avatar

Keith Elliott keithelliott

View GitHub Profile
@keithelliott
keithelliott / namespace.js
Created July 25, 2012 19:03
Creating javascript namespaces
// Chatham Namespace for exposing javascript functionality
// We can expose all of our functionality via this one global var
var CHATHAM = CHATHAM || {};
CHATHAM.namespace = function (namespace_name_string) {
var parts = namespace_name_string.split('.'),
parent = CHATHAM,
i, cnt;
// remove the first part of the string which will be 'CHATHAM'
@keithelliott
keithelliott / SpecRunner.html
Created July 24, 2012 17:45
Example Jasmine SpecRunner html file
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Jasmine Spec Runner</title>
<link rel="shortcut icon" type="image/png" href="lib/jasmine-1.2.0/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="lib/jasmine-1.2.0/jasmine.css">
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine.js"></script>
<script type="text/javascript" src="lib/jasmine-1.2.0/jasmine-html.js"></script>
@keithelliott
keithelliott / exampleTest.js
Created July 23, 2012 23:58
Jasmine Example
describe("Chatham's Url Loader", function(){
it("takes a string and returns a url", function(){
expect("index").toBe("www.chathamfinancial.com");
});
});