Skip to content

Instantly share code, notes, and snippets.

View cleftheris's full-sized avatar

Constantinos Leftheris cleftheris

View GitHub Profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@trailmax
trailmax / AzureStorageApi
Last active March 10, 2021 11:02
Unit testing the functionality to upload files to Azure Blob Storage via REST API. For blog post: http://tech.trailmax.info/2013/11/how-to-test-code-for-accessing-azure-storage-rest-api/ Please note, this implementation only supports file up to 64Mb in size. Anything larger and you need to chop files in pieces and upload them separately. There i…
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
namespace PackageUploader.Azure
{
public class AzureStorageApi
{
public void UploadFile(String fullFilePath, String blobSasUri, Dictionary<String, String> metadata = null)
@filipw
filipw / CompiledPropertyAccessor.cs
Last active March 4, 2024 04:17
removed unnecessary classes
using System;
using System.Linq.Expressions;
using System.Reflection;
using WebApi.Delta;
namespace Hst.Deals.API.Infrastructure
{
internal class CompiledPropertyAccessor<TEntityType> : PropertyAccessor<TEntityType> where TEntityType : class
{
private Action<TEntityType, object> _setter;