Skip to content

Code snippets for different languages to be used in Visual Studio or VSCode

Notifications You must be signed in to change notification settings

kbrashears5/code-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Snippets

Code snippets for various programming languages

Snippets

Guard Clauses

Snippet Description Shortcut C# Typescript
GuardClause_Number Guard clause to check for number equal to zero gcn Yes Yes
GuardClause_Number_Set Guard clause to check for number equal to zero and then set a class variable gcns Yes Yes
GuardClause_Object Guard clause to check for null or undefined objects gco Yes Yes
GuardClause_Object_Set Guard clause to check for null or undefined objects and then set a class variable gcos Yes Yes
GuardClause_String Guard clause to check for null or empty strings gcs Yes Yes
GuardClause_String_Set Guard clause to check for null or empty strings and then set a class variable gcss Yes Yes

Using snippets

Visual Studio

Tools -> Code Snippets Manager

Import -> Select appropriate files

Continue through the prompts

VS Code

[ctrl] + [shift] + P

Preferences: Configure User Snippets

Select the appropriate language and then use the correct json file:

About

Code snippets for different languages to be used in Visual Studio or VSCode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published