Skip to content

Instantly share code, notes, and snippets.

@chandu
chandu / gist:2229857
Created March 28, 2012 19:44
FluentSecurity - Caching scenarios

FluentSecurity - Policy Caching scenarios

Please feel free to contribute! Improvements and/or new scenarios are most welcome.

Controllers and actions

BlogController

  • ListPosts
  • AddPost
  • EditPost
@chandu
chandu / Examples
Created January 19, 2013 21:06 — forked from davidfowl/Examples
# Print all project items
Recurse-Project -Action {param($item) "`"$($item.ProjectItem.Name)`" is a $($item.Type)" }
# Function to format all documents based on https://gist.github.com/984353
function Format-Document {
param(
[parameter(ValueFromPipelineByPropertyName = $true)]
[string[]]$ProjectName
)
Process {
@chandu
chandu / gist:7282799
Created November 2, 2013 19:51
StructureMap Interface and Class Resolution issue.
[TestFixture]
public class IoCTests
{
[Test]
public void Can_Resolve_same_instance_when_asked_by_interface_and_class()
{
//Arrange
ObjectFactory.Initialize(x =>
{
x.For<FooBar>()
[Subject("Calculator ")]
internal class DummySpec
{
class Calculator
{
public int add(int a, int b)
{
return a+b;
}
}
public class LoginViewModel
{
public string UserName { get; set; }
public string Password { get; set; }
public bool RememberMe { get; set; }
//TODO: (CV) These should go to ViewBag later
public IDictionary<string, IEnumerable<string>> Errors { get; set; }
var $ = require('jquery');

Keybase proof

I hereby claim:

  • I am chandu on github.
  • I am chandu (https://keybase.io/chandu) on keybase.
  • I have a public key whose fingerprint is 5D8A 9018 802E ADC1 4EA3 86DE BBC8 9C07 9453 2ED4

To claim this, I am signing this object:

@chandu
chandu / gist:11050921
Created April 18, 2014 15:49
FluentSecurity v3
  • FluentSecuriyt.Core
    • Policy configuration infrastructure
    • Policy enforcement infrastructure
    • Skeleton for pluggable policies
@chandu
chandu / AwsResponse
Created April 21, 2014 16:41
Revised Awsresponse.cs implementation to avoid DeadLock while using task<T>.Result based on
public XElement ExecuteRequest(NameValueCollection arguments)
{
var task = ExecuteRequestAsync(arguments);
return task.Result;
}
public async Task<XElement> ExecuteRequestAsync(NameValueCollection arguments)
{
arguments = AddStandardArguments(arguments);
var argumentString = WriteQueryString(arguments);
var modules= require('modules');
var jquery = require(modules.jquery);
/// Do something with the jquery