This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ``` | |
* ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ | |
* ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ | |
* ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░▌ | |
* ▐░▌ ▐░▌ ▐░▌ ▐░▌ ▐░▌▐░▌ | |
* ▐░▌ ▐░█▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌ ▐░▌▐░▌ | |
* ▐░▌ ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌ ▐░▌▐░▌ | |
* ▐░▌ ▀▀▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀█░▌▐░█▄▄▄▄▄▄▄█░▌▐░▌ | |
* ▐░▌ ▐░▌ ▐░▌▐░░░░░░░░░░░▌▐░▌ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System; | |
using System.IO; | |
using System.Text; | |
namespace BensWordCounter | |
{ | |
public class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.IO; | |
using System.Linq; | |
namespace PixelSort | |
{ | |
class Program | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace MerryChristmas | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
Console.WriteLine(RandomString(-993131628) + " " + RandomString(-2146778827)); | |
Console.ReadKey(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ContentProviders { | |
enum DeferredState { | |
Done, | |
Failed, | |
Pending | |
} | |
export class Deferred { | |
private _done: Function[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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== |
NewerOlder