This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void Should_be_able_to_wrap_interface_with_one_method() | |
{ | |
Func<string, int> length = s => s.Length; | |
var wrapped = DelegateWrapper.WrapAs<IAnsweringEngine>( length ); | |
Assert.NotNull( wrapped ); | |
var i = wrapped.GetAnswer( "Answer to Life the Universe and Everything" ); | |
Assert.Equal( 42, i ); | |
} | |
//from http://kozmic.pl/2009/03/20/castle-dynamic-proxy-tutorial-part-viii-interface-proxy-without-target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Newtonsoft.Json; | |
using Newtonsoft.Json.Serialization; | |
//Example Usage | |
/* | |
var otherTypeObj = new SomeOneElsesType(); | |
var settings = new JsonSerializerSettings() | |
{ | |
ReferenceLoopHandling = ReferenceLoopHandling.Ignore, | |
ContractResolver = new WhiteListPropertyResolver("Name","Number","Display","Required","MaxLen","MinLen","Type") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#a fancy sorting function | |
sortWithComparisonMod = (obj, value, context, comparisonFunc) -> | |
#context and comparisonFunc are optional. if comparisonFunc is null and context is a function, then they've | |
#given us comparisonFunc in the second index | |
if _.isFunction(context) && not comparisonFunc? then (comparisonFunc = context;context = obj) | |
#if they didn't specify a comparisonFunc then they should just use the regular _.sortBy | |
if not comparisonFunc? then return _.sortBy(obj,value,context) | |
#normalize the iterator | |
iterator = if _.isFunction(value) then value else (obj) -> obj[value] | |
#rest of the sort function, this is kindof like how .NET does lambda closures! neato. From _.js 1.4.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
using Cubrd.Services.DTOs; | |
namespace Cubrd.Services.Utility | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enable-RemoteDesktop | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
cinst IIS-WebServerRole -source windowsfeatures | |
cinst smtp4dev | |
cinst eazfuscator.net | |
cinst firefox | |
cinst googlechrome | |
cinst lastpass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
cinst jre8 | |
cinst dotnet3.5 | |
cinst DotNet4.5 | |
cinst eazfuscator.net | |
cinst firefox | |
cinst putty | |
cinst putty.install | |
cinst winrar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')) | |
CINST Boxstarter | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
cinst git | |
cinst git.install | |
cinst tortoisegit | |
cinst notepadplusplus | |
cinst notepadplusplus.install | |
cinst winmerge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enable-RemoteDesktop | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
cinst IIS-WebServerRole -source windowsfeatures | |
cinst lastpass | |
cinst putty | |
cinst putty.install | |
cinst everything | |
cinst winrar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
I think the next best way to go is to investigate hooking into ninject | |
and ninject.dynamicproxy to dynamically add the attributes to a proxy class that we hand off to wcf. | |
We can't just make our own dynamic proxy because we lose the dependency injection on the instance that ninject already gave us | |
BUT maybe if there's a dynamic proxy that just wraps the instance it was already given? | |
class myclass { | |
public foo() {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"adPDCVMName": { | |
"type": "string" | |
}, | |
"adAvailabilitySetName": { | |
"type": "string" | |
}, |
OlderNewer