Skip to content

Instantly share code, notes, and snippets.

Avatar
👻

MJendza mjendza

👻
View GitHub Profile
View ARM deployment
trigger:
branches:
include:
- '*'
pool:
vmImage: 'ubuntu-latest'
steps:
- task: AzureResourceManagerTemplateDeployment@3
@mjendza
mjendza / C# Version Cheat Sheet.md
Created May 26, 2020 — forked from Gutek/C# Version Cheat Sheet.md
Short cheat sheet of changes in C# language from version 6 to 9
View C# Version Cheat Sheet.md

CS 6

read-only auto properties

Small help with immutable types...

// private readonly int _age;
// public int Age { get { return _age; } }
public int Age { get; }
View docker-compose.yaml
version: '2.1'
services:
grafana:
container_name: grafana
image: proxx/grafana-armv7
user: "1000"
ports:
- 3000:3000
volumes:
- /opt/grafana:/etc/grafana:rw
View TaskFakeService
[InterceptLogger(1)]
public class TaskFakeService : ITaskService
{
public int GetById(int id)
{
return 1;
}
[InterceptExceptions(2)]
public IList<int> GetAll()
View InterceptLoggerAttribute
public class InterceptLoggerAttribute : InterceptAttribute
{
public InterceptLoggerAttribute(int order)
{
this.Order = order;
}
public override IInterceptor CreateInterceptor(IProxyRequest request)
{
View LoggerInterceptor
public class LoggerInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
var logger = invocation.Request.Context.Kernel.Get<Logger>();
logger.Trace(string.Format("Start method {0} with {1}", invocation.Request.Method.Name, ArgumentsToString(invocation.Request.Arguments)));
invocation.Proceed();
logger.Trace(string.Format("End method {0} with {1}", invocation.Request.Method.Name, invocation.ReturnValue.ToString()));
}
View binding
kernel.Bind<ITaskService>().To<TaskService>().Intercept().With<ServiceInterceptor>();
View check_features.ps1
function Read-Onet{
param (
[string] $path
)
asnp *sharepoint*
$file = "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\" + "TEMPLATE\" + $path+"\xml\onet.xml";
write-host $file
if (Test-Path $file) {
[xml]$onet = Get-Content $($file)
You can’t perform that action at this time.