Skip to content

Instantly share code, notes, and snippets.

@panicoenlaxbox
panicoenlaxbox / DownloadFileAndBlobInWrongAndRightWay.cs
Last active September 12, 2019 19:32
Download file and blob in wrong and right way
//<Project Sdk="Microsoft.NET.Sdk">
// <PropertyGroup>
// <OutputType>Exe</OutputType>
// <TargetFramework>netcoreapp2.2</TargetFramework>
// </PropertyGroup>
// <ItemGroup>
// <PackageReference Include="CsvHelper" Version="12.1.2" />
// <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.6" />
// <PackageReference Include="TinyCsvParser" Version="2.5.2" />
// <PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
function memoize(fn: any): any {
console.log('memoize');
const cache = {};
return function () {
const key: string = JSON.stringify(arguments);
if (cache[key]) {
console.log(`${key} found in cache`);
return cache[key];
}
else {
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication1
{
public class DbCException : Exception
{
public DbCException()
{
@panicoenlaxbox
panicoenlaxbox / gist:894a904afabf90ecdd6f
Last active December 21, 2016 09:24
View Nuget dependencies hierarchy
using System;
using System.Linq;
using System.Runtime.Versioning;
using NuGet;
namespace ConsoleApplication1
{
/// <summary>
/// View Nuget dependencies hierarchy
/// </summary>
@panicoenlaxbox
panicoenlaxbox / gist:5c6784e2be1171eed003
Created May 20, 2014 08:55
MongoCSharpDriver deserialize anonymous type
public class TempDataDocument
{
public string Id { get; set; }
public string Key { get; set; }
public object Value { get; set; } // Aquí puede ir cualquier cosa
}
public static void Main()
{
var client = new MongoClient("mongodb://localhost:27017");