Skip to content

Instantly share code, notes, and snippets.

@RealDotNetDave
RealDotNetDave / .editorConfig
Last active April 11, 2024 13:36
.editorConfig by David (dotNetDave) McCarter - dotNetTips.com
# dotNetDave's (David McCarter) Editor Config - dotNetTips.com
# Updates to this file are posted quarterly at: https://bit.ly/EditorConfig5
# Updated February 14, 2024
# dotNetDave's NEW coding standards book is available at: https://bit.ly/CodingStandards8
# Rockin' the Code World with dotNetDave (weekly live show): https://bit.ly/RockinCodeWorldShows
root = true
# All Files
[*]
@AArnott
AArnott / Cancellation.cs
Last active December 12, 2023 16:33
Graceful console app cancellation on Ctrl+C
class Program
{
static async Task Main(string[] args)
{
// Add this to your C# console app's Main method to give yourself
// a CancellationToken that is canceled when the user hits Ctrl+C.
var cts = new CancellationTokenSource();
Console.CancelKeyPress += (s, e) =>
{
Console.WriteLine("Canceling...");
@JasonKleban
JasonKleban / LiteEvent.ts
Last active January 26, 2023 06:33
TypeScript LiteEvent Events implementation
interface ILiteEvent<T> {
on(handler: { (data?: T): void }) : void;
off(handler: { (data?: T): void }) : void;
}
class LiteEvent<T> implements ILiteEvent<T> {
private handlers: { (data?: T): void; }[] = [];
public on(handler: { (data?: T): void }) : void {
this.handlers.push(handler);
@xperiments
xperiments / Dictionary.ts
Created June 25, 2013 18:48
Typescript Dictionary
//http://stackoverflow.com/questions/15877362/declare-and-initialize-a-dictionary-in-typescript
interface IDictionary {
add(key: string, value: any): void;
remove(key: string): void;
containsKey(key: string): bool;
keys(): string[];
values(): any[];
}
@throughnothing
throughnothing / README.md
Last active January 17, 2017 13:37
Readability send-to-kindle.js

Looks like they POST => /kindle/queue, which returns a 302 redirect to a url with an id, or something like that?