This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
| public class NinjectFactory : IFactory | |
| { | |
| private readonly IKernel kernel; | |
| public Factory(IKernel kernel) | |
| { | |
| this.kernel = kernel; | |
| } | |
| public T Get<T>() |
| // You can extend the parser by adding a new parsing function to the `XDate.parsers` array. | |
| // This function is given a single string argument and should return an XDate if parsing was successful. | |
| function parseMDY(str) { | |
| // this example parses dates like "month/date/year" | |
| var parts = str.split('/'); | |
| if (parts.length == 3) { | |
| return new XDate( | |
| parseInt(parts[2]), // year |