This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("Chatham's Url Loader", function(){ | |
it("takes a string and returns a url", function(){ | |
expect("index").toBe("www.chathamfinancial.com"); | |
}); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//uses the following syntax to create an object with private properties | |
// and functions. You expose the properties and functions you need publicly in the | |
// return object.... The immediate function allows us to have private scope for | |
// certain things | |
// Create a new namespace | |
CHATHAM.namespace('CHATHAM.utils.gridmgr'); | |
CHATHAM.utils.gridmgr = (function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example 1: Wrapping function and passing in global variables | |
// self-executing function that passes in the global context via this when the file loads | |
(function myGlobalExample(global){ | |
return { | |
testFn: function(){ | |
var doIt = global.doItTimes(5); | |
return doIt; | |
} | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// End each statement with a semicolon | |
// example 1 - var that is assigned to a function | |
var foo = function(){ | |
// do some stuff | |
}; // semicolon required to end statement | |
// Example 2 - no semicolon needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// When using setTimeout, use one of the following patterns | |
//ex1 | |
var fn1 = function(){ | |
// do something | |
}; | |
setTimeout(fn1, 0); | |
//ex2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int const CURRENT_YEAR = 2013; | |
static int const MAX_YEARS = 20; | |
@interface WineUtils : NSObject | |
@property(nonatomic, strong) NSDictionary *wineRegionsDict; | |
@property (nonatomic, strong) NSArray *wineTypes; | |
@property (nonatomic, strong) NSArray *wineYears; | |
- (NSArray *)wineRegionsForCountry:(NSString *)country; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@class ChooserViewController; | |
static int const HIGHEST_RATING = 5; | |
static int const LOWEST_RATING = 1; | |
static int const CHOOSER_VIEW = 5000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@class WineUtils; | |
static int const COMPONENTS_IN_REGION = 2; | |
static int const COMPONENTS_DEFAULT = 1; | |
typedef enum ChooserUIEnum{ | |
CTYear, | |
CTRegion, | |
CTType |
OlderNewer