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 query generates a list of as many numbers as you want, for Microsoft SQL Server. | |
DECLARE @Quantity INT = 100000; -- how many to generate | |
DECLARE @Growth INT = 10; -- exponential growth rate | |
WITH base AS ( | |
SELECT number | |
FROM master..spt_values | |
WHERE type = 'P' | |
AND number < @Growth |
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
/** | |
* WARNING! | |
* Just because you can doesn't mean you should. | |
* | |
* It's not very hard to create types with exponential (or worse!) time complexity. | |
* These can create serious issues at build time, such as running out of memory. | |
* Use caution when doing metaprogramming like this. Nothing is truly free. | |
* | |
* This file is best viewed in an environment with intellisense. | |
*/ |
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
( () => { | |
let custodian = new FinalizationRegistry((x) => console.log(x)) | |
let leak = {haha: "funni"} | |
custodian.register(leak, {leak}) | |
} )() |
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 Typewriter.Extensions.Types; | |
using System.Text.RegularExpressions; | |
using System.Reflection; | |
/* | |
__TypewriterControllers.tst v1.1.1 - https://gist.github.com/Fasteroid | |
Features: | |
- Automatically imports type dependencies from the same assembly |
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 Typewriter.VisualStudio; | |
static ILog console; | |
Template(Settings settings){ | |
console = settings.Log; | |
} | |
/* | |
__TypewriterModels.tst v1.2.0 - https://gist.github.com/Fasteroid |
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
/****** 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 |
NewerOlder