Skip to content

Instantly share code, notes, and snippets.

@Buildstarted
Buildstarted / paste.html
Last active December 12, 2024 17:31
Used to capture the clipboard in both mozilla and webkit browsers
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
</head>
<body>
<!-- normally you wouldn't show this -->
<div id="paste" contenteditable="true"></div>
<script type="text/javascript">
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}");
<div id="bored" class="step slide" data-x="-1000" data-y="-1500">
<q>Aren't you just <b>bored</b> with all those slides-based presentations?</q>
</div>
<div class="step slide" data-x="0" data-y="-1500">
<q>Don't you think that presentations given <strong>in modern browsers</strong> shouldn't <strong>copy the limits</strong> of 'classic' slide decks?</q>
</div>
<div class="step slide" data-x="1000" data-y="-1500">
<q>Would you like to <strong>impress your audience</strong> with <strong>stunning visualization</strong> of your talk?</q>
</div>
@Buildstarted
Buildstarted / TypeBuilderFromJson.cs
Created August 1, 2012 05:43
Creates a concrete type from json
public static class TypeBuilderFromJson
{
public static Type CreateType(JObject jObject)
{
var dict = new Dictionary<string, object>();
foreach (var child in jObject)
{
dict.Add(child.Key, child.Value);
}
return CompileResultType(dict);
@Buildstarted
Buildstarted / timers.ts
Created November 14, 2013 05:47
4 different timer implementations in typescript
module Utilities {
export class Timer implements eg.IUpdateable {
private OnTick: eg.EventHandler;
private _start: number;
private _interval: number;
private _started: boolean;
private _lastTime: number;
constructor(interval: eg.TimeSpan);
constructor(interval: eg.TimeSpan, callback?: Function);
@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 / WindowsAzureServiceBusQueueTest.cs
Created August 15, 2012 02:14
Testing Windows Azure Service Bus with reply queues
class WindowsAzureServiceBusQueueTest
{
private static readonly string ClientId = Guid.NewGuid().ToString("N");
private TokenProvider _credentials;
private NamespaceManager _namespaceClient;
private MessagingFactory _factory;
static void Main(string[] args)
@Buildstarted
Buildstarted / BloomFilter.cs
Last active January 3, 2019 04:05
Basic Bloom Filter implementation inspired by Kellabyte
namespace BST
{
using System;
using System.Collections;
public class BloomFilter<T>
{
private readonly int _size;
//how many times to run the hash method
@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
{