Skip to content

Instantly share code, notes, and snippets.

View DerAlbertCom's full-sized avatar

Albert Weinert DerAlbertCom

View GitHub Profile
#requires -Version 2 -Modules posh-git
function Write-Theme {
param(
[bool]
$lastCommandFailed,
[string]
$with
)
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Linq;
using System.Web.Mvc;
using Training.Web.Data;
using Training.Web.Entities;
namespace Training.Web.Controllers
{
@DerAlbertCom
DerAlbertCom / ch9downloader.ps1
Created November 21, 2012 20:08
A comfortable Channel 9 video download script
# channel9 downloader, downloads complete channel9 videos from there rss feeds
#
# Features
# * Checks for allready downloaded files
# * use a tempfile to ensure full downloads
# * gives the download file a name based on the title of the rss entry in the feed
# * creates a proper directory structure
# * set the creation und modified date to the date in the rss entry
#
# by Albert Weinert http://der-albert.com
@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"
@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 / 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 / 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 / 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 / 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 / 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)