Skip to content

Instantly share code, notes, and snippets.

View kkozmic's full-sized avatar
🎯
Focusing

Krzysztof Kozmic kkozmic

🎯
Focusing
View GitHub Profile
public sealed class NHibernateProxyGenerationHook:IProxyGenerationHook
{
public bool ShouldInterceptMethod(Type type, MethodInfo methodInfo)
{
// unless for some reason you don't want to intercept everything you can
return true;
}
public void NonProxyableMemberNotification(Type type, MemberInfo memberInfo)
{
public ActionResult TryAuth(string openid_identifier)
{
var openid = new OpenIdRelyingParty();
var response = openid.GetResponse();
if(response== null)
{
var req = openid.CreateRequest(openid_identifier);
req.AddExtension(new ClaimsRequest
{
D:\dev\rb\bin>gem install rails
Successfully installed rails-3.0.0
1 gem installed
Installing ri documentation for rails-3.0.0...
File not found: lib
// from http://forum.cyanogenmod.com/topic/5385-rom-cyanogenmod-6-for-desire-v600-08282010/
1. Root your device and install Clockwork Recovery (Unrevoked method is recommended).
2. Do a Nandroid backup!
3. Update your radio! New radio from 2.2 roms is required, see downloads below.
4. WIPE
5. Install the ROM
5. Optionally install the Google Addon
// in pseudo API not specific to any particular container
container.Register<FooBar>().AsService<IFoo,IBar>().Singleton;
var one = container.Resolve<IFoo>();
var two = container.Resolve<IBar>();
Assert.AreSame(one, two);
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using Castle.DynamicProxy;
namespace ConsoleApplication7
{
public interface IFoo
{
void Foo();
}
public class Base:IFoo
{
public void Foo()
{
}
[TestFixture]
public class Base
{
protected int @base;
[SetUp]
public void BaseSetUp()
{
@base = 4;
}
public class FirstArgumentIsServiceSelector:DefaultTypedFactoryComponentSelector
{
protected override Type GetComponentType(MethodInfo method, object[] arguments)
{
return (Type)arguments.Single();
}
}
@kkozmic
kkozmic / gist:659225
Created November 2, 2010 03:21
list of things I will be talking about at CodeCampOz conference
patterns and antipatterns of IoC container usage (in broad, broad strokes)
- antipatterns
service locator
static dependencies
xml programming