Skip to content

Instantly share code, notes, and snippets.

View DerAlbertCom's full-sized avatar

Albert Weinert DerAlbertCom

View GitHub Profile
using System;
using System.ComponentModel.DataAnnotations;
namespace Regularly.DomainObjects
{
public abstract class DomainObject
{
protected DomainObject()
{
@DerAlbertCom
DerAlbertCom / Calendar.cs
Created November 11, 2010 08:53
Simple Test
using System;
namespace Aperea.iCalendar
{
public class Calendar
{
public void SetTime(DateTime dateTime)
{
}
@DerAlbertCom
DerAlbertCom / GenericModelBinderProvider.cs
Created November 22, 2010 10:50
DependicyInjection in ModelBinder MVC 3
using System;
using System.Web.Mvc;
namespace NewInMVC3.ModelBinder
{
public class GenericModelBinderProvider : IModelBinderProvider
{
public IModelBinder GetBinder(Type modelType)
{
var genericType = typeof (IModelBinder<>).MakeGenericType(modelType);
@DerAlbertCom
DerAlbertCom / ControllerRegistryConvention.cs
Created November 22, 2010 10:54
Simple Registration of Services and Controller for ASP.MVC 3 with StructureMap
using System;
using System.Web.Mvc;
using StructureMap.Configuration.DSL;
using StructureMap.Graph;
namespace NewInMVC3.Infrastructure
{
internal class ControllerRegistryConvention : IRegistrationConvention
{
public void Process(Type type, Registry registry)
@DerAlbertCom
DerAlbertCom / Channel9Downloader.ps1
Created February 21, 2011 20:35
PowerShell Scripts for Downloading Channel 9 Videos
# --- settings ---
$feedUrl = $Args[0]
$url = New-Object System.Uri($feedUrl)
$overwrite = $false
$destinationDirectory = join-path "C:\Channel9\" $url.Segments[-2]
# Download filter options
# "_high_ch9\.mp4" - High quality mp4
# "_low_ch9\.mp4" - Low quality mp4
@DerAlbertCom
DerAlbertCom / SpikeCreateObject.cs
Created February 24, 2011 13:49
A quick spike for setting the SubjectCreator in BehaviorConfigBase
using FakeItEasy;
using Machine.Fakes;
using Machine.Specifications;
using UserGroup.Web.Models;
using UserGroup.Web.Services;
namespace UserGroup.Web.Specs.Models
{
public class ANewWebUser : BehaviorConfigBase
{
@DerAlbertCom
DerAlbertCom / gist:886696
Created March 25, 2011 11:10
Simple Query
var attendees = repository.GetAttendess();
var registrations = repository.GetRegistrationsForMeeting(meetingId, searchTerm);
var query = from registration in registrations
join attendee in attendees on registration.WebUser equals attendee.WebUser
orderby registration.Updated
select new MeetingListProjection
{
UserID = registration.WebUser.ID,
@DerAlbertCom
DerAlbertCom / style.css
Created June 29, 2011 13:15
Retro-Rahmen
div.camplogo
{
text-align: center;
position: absolute;
background: rgba(255, 255, 255, 0.5);
width: 240px;
height: 116px;
left: 75px;
top: 0px;
z-index: 1;
@DerAlbertCom
DerAlbertCom / DocumentSessionFactory.cs
Created July 22, 2011 14:34
Private Property Setter Serialization with RavenDb.
using Raven.Client;
using Raven.Client.Document;
namespace Aperea.Infrastructure.Data
{
public class DocumentSessionFactory : IDocumentSessionFactory
{
readonly DocumentStore _documentStore;
public DocumentSessionFactory()
@DerAlbertCom
DerAlbertCom / blendfix.bat
Created November 24, 2011 17:06
Fixes Expression Blend 4 crashes on startup when you have installed .NET Framework 4.5 Developer Preview
cd %windir%\Microsoft.NET\Framework\v4.0.30319
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Blend.dll"
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Code.dll"
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.DesignModel.dll"
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.DesignSurface.dll"
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Extensibility.Designer.dll"
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Extensibility.dll"
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Extensibility.Project.dll"
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Framework.dll"
ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Importers.dll"