- Step 1
- Step 2
- Step 3 - Profit
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
var lookup = { | |
A: { Source: "CAN", Destination: "USD" }, | |
B: { Source: "CAN", Destination: "USD" }, | |
C: { Source: "CAN", Destination: "USD" }, | |
D: { Source: "CAN", Destination: "USD" }, | |
E: { Source: "USD", Destination: "CAD" }, | |
F: { Source: "USD", Destination: "CAD" }, | |
}; | |
var key = "A"; |
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
var EventDispatcher = { | |
listeners: {}, | |
register: function(eventName, callback) { | |
if (typeof this.listeners[eventName] == 'undefined') { | |
this.listeners[eventName] = []; | |
} | |
this.listeners[eventName].push(callback); | |
}, |
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
Show hidden characters
{ | |
// -------------------------------------------------------------------- | |
// JSHint Configuration, Strict Edition | |
// -------------------------------------------------------------------- | |
// | |
// This is a options template for [JSHint][1], using [JSHint example][2] | |
// and [Ory Band's example][3] as basis and setting config values to | |
// be most strict: | |
// | |
// * set all enforcing options to true |
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 url('http://getbootstrap.com/dist/css/bootstrap.css'); | |
.page-header { | |
padding: 15px; | |
background-color: rgb(0, 175, 0); | |
color: #111; | |
} |
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
ul { | |
list-style-type: disc; | |
margin:0 0 0 2em; | |
} | |
li { | |
margin:0 0 .5em; | |
} | |
body { | |
font-family:"Verdana"; | |
font-size: 9pt; |
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
public class F | |
{ | |
public string Field1 { get; set; } | |
public string Field2 { get; set; } | |
} | |
public class P | |
{ | |
public string Field1 { get; set; } | |
public string Field2 { get; set; } |
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
ul { | |
list-style-type: disc; | |
margin:0 0 0 2em; | |
} | |
li { | |
margin:0 0 .5em; | |
} | |
body { | |
font-family: "Verdana"; |
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
test("When round object properties expect numbers to be rounded to 2 places.", function () { | |
// If property belongs to the object, is numeric, and is not null change to 2 decimal places. | |
// TODO: Return a cloned copy of the object () instead of mutating it. | |
var roundProperties = function (obj) { | |
for (var prop in obj) { | |
if ((!obj.hasOwnProperty(prop)) || (isNaN(obj[prop])) || (obj[prop] === null)) | |
continue; | |
obj[prop] = obj[prop].toFixed(2); |
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
-- Get the last day of the current month. | |
SELECT | |
DATEADD(s,-1, | |
DATEADD(mm, | |
DATEDIFF(m,0,'2012/08/31') -- Get # of months since '1753-01-01' | |
+1,0) -- Get the date by adding # of months + 1 | |
) -- Remove one second so date rolls back to the last second of the original month | |
-- Get the last day of the previous month. | |
SELECT |