Skip to content

Instantly share code, notes, and snippets.

@dalexsoto
dalexsoto / HttpClientProgressExtensions.cs
Last active April 3, 2024 15:01
Add Progress reporting to capabilities to HttpClient
using System;
using System.IO;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace HttpClientProgress {
public static class HttpClientProgressExtensions {
public static async Task DownloadDataAsync (this HttpClient client, string requestUrl, Stream destination, IProgress<float> progress = null, CancellationToken cancellationToken = default (CancellationToken))
{
@gambrell
gambrell / logstash-remove-nulls.conf
Created March 19, 2015 13:47
Logstash filter to remove embedded NULL characters
# Logstash filter to remove embedded NULL characters
filter {
mutate {
gsub => [
# Replace all NULL characters empty string. Do this to the message field first which will apply to all fields instead of specifying individual fields.
"message", "[\u0000]", ""
]
}
@sixeyed
sixeyed / DiagnosticCheckCollection.cs
Created January 15, 2014 21:29
Generic server diagnostics - with WebApi controller sample
using System.Collections.Generic;
namespace Sixeyed.Diagnostics.Models
{
public class DiagnosticCheckCollection
{
public string CollectionName { get; set; }
public bool? Passed { get; set; }
@selvan
selvan / chrome-bookmarks
Created December 16, 2012 15:26
Chrome extension to export all bookmarks
//manifest.json
{
"name": "bookmark-search-export",
"version": "1.0",
"manifest_version": 2,
"description": "This extention will dump all bookmarks",
"browser_action": {
"default_icon": "icon.png"
},
"background": {