Skip to content

Instantly share code, notes, and snippets.

View n8osapi's full-sized avatar

Nate Kelley n8osapi

  • Cellular Sales
  • Knoxville, TN
  • X @n8osapi
View GitHub Profile
@n8osapi
n8osapi / xdate_extending_parser.js
Created March 6, 2012 23:08 — forked from arshaw/xdate_extending_parser.js
XDate: Extending the Parser
// 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
@n8osapi
n8osapi / Factory.cs
Created February 14, 2012 18:41 — forked from bfriesen/Factory.cs
Yo dawg, I heard you like dependency injection, so I injected a ninject factory that uses a ninject kernel into your controller using the same ninject kernel so you can inject multiple dependencies without having to inject each one individually.
public class NinjectFactory : IFactory
{
private readonly IKernel kernel;
public Factory(IKernel kernel)
{
this.kernel = kernel;
}
public T Get<T>()
@n8osapi
n8osapi / about.md
Created August 11, 2011 02:36 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer