Skip to content

Instantly share code, notes, and snippets.

using System.Net.Mime;
using Xabe.FFmpeg;
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
FFmpeg.SetExecutablesPath(@"C:\Temp\Tools\ffmpeg\bin");
app.MapGet("/thumbnail/{filename}", async (string filename, HttpContext context) => {
var i = await FFmpeg.GetMediaInfo($@"C:\Temp\files\{filename}");
@Buildstarted
Buildstarted / netcore linecount
Last active January 21, 2020 15:04 — forked from aarondandy/netcore linecount
netcore 3.1. hardcoded to the location of a 1.6gb text file
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System;
using System.IO;
using System.Text;
namespace BensWordCounter
{
public class Program
{
using System;
namespace NumberCrazy
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Number(1) == 1: {0}", new Number(1) == 1);
Console.WriteLine("Number(2) > 1: {0}", new Number(2) > 1);
// POST api/values
[HttpPost]
[ActionName("Complex")]
public HttpResponseMessage PostComplex(TwoField twoField)
{
List<string> list = new List<string>();
var name = "undefined";
if(ModelState.IsValid && twoField != null)
using System;
using System.Reflection;
using CommonDomain;
using CommonDomain.Core;
using CommonDomain.Persistence;
using CommonDomain.Persistence.EventStore;
using EventStore;
using EventStore.Dispatcher;
using System;
using System.Reflection;
using CommonDomain;
using CommonDomain.Core;
using CommonDomain.Persistence;
using CommonDomain.Persistence.EventStore;
using EventStore;
using EventStore.Dispatcher;
function stringFormat (formatString)
{
var builder = [];
var st = 0;
var j = 0;
for (var i = 0; i < formatString.length; i++)
{
switch (st)
@Buildstarted
Buildstarted / uri.js
Created January 30, 2013 01:50 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@Buildstarted
Buildstarted / gist:3182600
Created July 26, 2012 15:06 — forked from davidfowl/gist:3172990
MethodInfo.Invoke is slow...
using System;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Reflection;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
@Buildstarted
Buildstarted / FindConflictingReferences.cs
Created June 14, 2012 22:29 — forked from brianlow/FindConflictingReferences.cs
Find conflicting assembly references
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using NUnit.Framework;
namespace MyProject
{
[TestFixture]