Skip to content

Instantly share code, notes, and snippets.

@faustinoaq
faustinoaq / myAngular.html
Last active May 6, 2025 15:35
Front-end libraries (React, Vue, Angular) and the basic principles of how they work, all in a single file using pure JavaScript (VanillaJS).
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Angular from Scratch</title>
<style>
.my-component {
font-family: Arial, sans-serif;
@RealDotNetDave
RealDotNetDave / .editorConfig
Last active May 1, 2025 15:51
.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 May 1, 2025
# Code performance book is available at: https://bit.ly/DotNetCodePerf4
# Coding standards book is available at: https://bit.ly/CodingStandards8
####################################################################################################
root = true
@AArnott
AArnott / Cancellation.cs
Last active October 16, 2024 17:10
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 November 5, 2024 18:59
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);
@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?

@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[];
}