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 / sql.ts
Last active September 28, 2020 18:51
/**
* ```
* ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄
* ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌
* ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░▌
* ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌
* ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌▐░▌
* ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌
* ▐░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌
* ▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌
@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
{
@Buildstarted
Buildstarted / pixelsort.cs
Last active September 22, 2017 18:01
Sorting pixels by various methods
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
namespace PixelSort
{
class Program
{
public class SqlBulkCopyHelper
{
public static async Task BulkInsert<T>(string connectionString, string tableName, string[] columns, IEnumerable<T> list, string[] ignoredColumns = null)
{
using (var connection = new SqlConnection(connectionString))
{
using (var bulkCopy = new SqlBulkCopy(connection))
{
await connection.OpenAsync();
bulkCopy.BulkCopyTimeout = 300;
using System;
namespace MerryChristmas
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine(RandomString(-993131628) + " " + RandomString(-2146778827));
Console.ReadKey();
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)
@Buildstarted
Buildstarted / contentproviders.ts
Created April 13, 2015 05:36
Directly ported content providers from http://jabbr.net to typescript
module ContentProviders {
enum DeferredState {
Done,
Failed,
Pending
}
export class Deferred {
private _done: Function[];
// ==UserScript==
// @name JabbR Firehose
// @namespace http://jabbr.buildstarted.com/
// @version 0.1
// @description firehose
// @match https://jabbr.net/*
// @copyright 2012+, You
// @require http://code.jquery.com/jquery-latest.js
// ==/UserScript==