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
@-moz-document domain("angular.dev") { | |
/* | |
Angular.dev "accessible" edit | |
Revision 2 | |
*/ | |
.docs-dark-mode, .docs-light-mode { | |
--red-to-pink-horizontal-gradient: var(--hot-red); | |
--red-to-pink-to-purple-horizontal-gradient: var(--vivid-pink); | |
--pink-to-highlight-to-purple-to-blue-horizontal-gradient: var(--electric-violet); |
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
/** | |
* Like a normal {@link Map}, but if you get a key that doesn't exist, it will automatically make it exist. | |
*/ | |
export class AutoMap<K, V> extends Map<K, V> { | |
/** | |
* @param computer Instantiates default value for keys that don't exist | |
*/ | |
public constructor( private computer: (key: K) => V ){ super(); } | |
public override get(key: K): V { |
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
import { MonoTypeOperatorFunction, Observable, Observer, OperatorFunction, Subject, Subscription, take, takeUntil } from "rxjs"; | |
import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; | |
import { DestroyRef, inject } from "@angular/core"; | |
const STUPID_DEV_WARNING: string = "While RxJS allows null subscriptions, I do not. Please remove this null subscription or fix it."; | |
/** | |
* A data conduit that auto-pushes its contents to new and existing subscribers once pressurized with {@linkcode Subject.next}. | |
* | |
* Might explode if connected circularly. |
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
/****** Object: StoredProcedure [dbo].[DropSchema] Script Date: 31/01/2013 16:51:00 ******/ | |
/* https://ruiromanoblog.wordpress.com/2011/01/27/drop-a-sql-server-schema-and-all-objects-related/ */ | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
DROP PROCEDURE IF EXISTS [dbo].[DropSchema] | |
GO | |
CREATE PROCEDURE [dbo].[DropSchema] | |
( |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
(""(?>[^""]|\\"")*?"")|(?!\( )(\()(?!\))(\1??(?>(?>""(?>[^""]|\\"")*?"")|.){4,})(\))(?<! \)) | |
$1$2 $3 $4 | |
For use in Visual Studio (.NET Regex Engine) | |
FEATURES | |
- Inserts space after opening and before closing parenthesis if contents between parentheses is longer than <x> (4 in this example) | |
- Does not do anything to strings | |
- Ignores parentheses that already have space | |
- Can be used multiple times to hit nested offenders |
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
import sys | |
import pkgutil | |
import importlib | |
def get_all_modules(): | |
all_modules = set(sys.modules.keys()) | |
# Add all discoverable modules | |
for module in pkgutil.iter_modules(): | |
all_modules.add(module.name) |
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
type Fruit = { | |
name: string | |
color: string | |
sweetness: number | |
} | |
type Apple = Fruit & { | |
variety: string | |
color: "red" | "green" | "yellow" | |
} |
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
// PLEASE CREDIT EVERYONE IN HERE IF YOU USE THIS PLEASE AND THANKS 🙏🙏🙏 | |
// https://itnext.io/implementing-arithmetic-within-typescripts-type-system-a1ef140a6f6f | |
// These types let you do (buggy) arithmetic within typescript's type system | |
type BuildTuple<L extends number, T extends any[] = []> = | |
T extends { length: L } ? T : BuildTuple<L, [...T, any]>; | |
type Length<T extends any[]> = | |
T extends { length: infer L } ? L : never; |
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
@use 'sass:map'; | |
@use '@angular/material' as mat; | |
@include mat.core(); | |
$my-app-primary: mat.define-palette(mat.$indigo-palette); | |
$my-app-accent: mat.define-palette(mat.$pink-palette); | |
$my-app-warn: mat.define-palette(mat.$amber-palette); | |
$my-app-theme: mat.define-light-theme( | |
( |
NewerOlder