Skip to content

Instantly share code, notes, and snippets.

@CallumVass
CallumVass / Currently Generated
Created April 11, 2014 07:37
Yeoman Angular Generator
app.js:
'use strict';
angular.module('yeomanTestApp', [
'ngCookies',
'ngResource',
'ngSanitize',
'ngRoute'
])
@CallumVass
CallumVass / Bootstrapper
Created March 13, 2014 15:12
Error: No registration for type IQueryHandler<EnrollmentDateQuery, List<EnrollmentDateGroup>> could be found.
container.RegisterSingle<IQueryProcessor, DynamicQueryProcessor>();
container.RegisterManyForOpenGeneric(typeof(IQueryHandler<,>), Assembly.GetExecutingAssembly());
PHP:
<?
session_start();
if(isset($_POST['submitted'])) {
$name = trim($_POST['name']);
$phone = trim($_POST['phone']);
$email = trim($_POST['email']);
$comment = trim($_POST['comment']);
@CallumVass
CallumVass / gist:8300400
Last active January 2, 2016 11:59
Hacky way to load the correct service for before/after save operations to provide additional validation / business logic to entities for Breeze JS
public class SalesAppContextProvider : EFContextProvider<SalesAppContext>
{
private readonly ServiceFactory _serviceFactory;
public SalesAppContextProvider(ServiceFactory serviceFactory)
{
_serviceFactory = serviceFactory;
}
protected override bool BeforeSaveEntity(EntityInfo entityInfo)
@CallumVass
CallumVass / gist:7391124
Created November 9, 2013 22:52
Error with Oak and Nancy Insert
public class Bootstrapper : DefaultNancyBootstrapper
{
protected override void ConfigureApplicationContainer(TinyIoCContainer container)
{
container.Register(new Customers());
}
}
public class Customers : DynamicRepository
{