Skip to content

Instantly share code, notes, and snippets.

@ArildF
ArildF / gist:1224281
Created September 17, 2011 19:41
Resolve Blend 4 crash on startup after installing VS 11/.NET 4.5
%windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Framework.dll"
%windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Blend.dll"
%windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.Project.dll"
If "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.WindowsPhone.dll" is present for scenarios like Blend V4 SP1 or future releases, please also run:
%windir%\Microsoft.NET\Framework\v4.0.30319\ngen uninstall "%ProgramFiles(x86)%\Microsoft Expression\Blend 4\Microsoft.Expression.WindowsPhone.dll"
@ArildF
ArildF / my code
Created July 13, 2011 16:03
my code so far
package FoldersPack;
import java.io.IOException;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.PosixFileAttributes;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
import java.nio.file.spi.FileSystemProvider;
@ArildF
ArildF / gist:1049747
Created June 27, 2011 20:24
Open generic decorators vs closed generic services
using System;
using System.Linq;
using Castle.MicroKernel;
using Castle.MicroKernel.Registration;
using Castle.Windsor;
using Machine.Specifications;
namespace RequestHandlers.Tests
{
public interface IThing<T>
@ArildF
ArildF / gist:995351
Created May 27, 2011 14:26
Create common bin directories through symlinks
param($linkTarget={throw "Link target must be specified"}, $rootDir=".")
ls $rootDir -Recurse -Include *.csproj | % { $_.DirectoryName } | % { Join-Path $_ -ChildPath "bin" } | % {
Write-Host "Creating link from $_ to $linkTarget"
if (Test-Path $_)
{
Remove-Item -Force -Recurse $_
cmd /c rd $_
}
@ArildF
ArildF / gist:911288
Created April 9, 2011 10:16
Replace calls with tail calls using Mono.Cecil
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mono.Cecil;
using Mono.Cecil.Cil;
namespace TailCalls
{
class Program
using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Markup;
using Rogue.Ptb.UI.Commands;
namespace Rogue.Ptb.UI.MarkupExtensions
{
[MarkupExtensionReturnType(typeof(ICommand))]
public class ResolveCommandExtension : MarkupExtension
@ArildF
ArildF / gist:788775
Created January 20, 2011 22:00
WF4 async activity
using System;
using System.Activities;
namespace WorkflowConsoleApplication1
{
public class AsyncActivity : AsyncCodeActivity
{
public InArgument<int> ActivityNumber { get; set; }
protected override IAsyncResult BeginExecute(AsyncCodeActivityContext context, AsyncCallback callback, object state)
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace ConsoleApplication6
{
public unsafe struct TheStruct
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace ConsoleApplication6
{
public struct TheStruct
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace ConsoleApplication6
{
public struct TheStruct