GithubHelp home page GithubHelp logo

usnippetpack's Introduction

uSnippetPack

Simple c# and js snippets pack that provides checks for strings and collections. This pack inspired by Snippetica. I do recommend use uSnippetPack with Snippetica

uSnippetPack is available for vs code and Visual Studio 2022

Available snippets

C#

String check snippets

Shortcut Generated Code
ifsnw if (string.IsNullOrWhiteSpace(str))
ifsnwb if (string.IsNullOrWhiteSpace(str)) { }
ifxsnw if (!string.IsNullOrWhiteSpace(str))
ifxsnwb if (!string.IsNullOrWhiteSpace(str)) { }
csnw string.IsNullOrWhiteSpace(str) ? true : false
cxsnw !string.IsNullOrWhiteSpace(str) ? true : false

Collection check snippets using Linq methods

Shortcut Generated Code
ifany if (collection.Any())
ifanyc if (collection.Any(i => <condition>))
ifanyb if (collection.Any()) {}
ifanycb if (collection.Any(i => <condition>)) { }
ifxany if (!collection.Any())
ifxanyc if (!collection.Any(i => <condition>))
ifxanyb if (!collection.Any()) {}
ifxanycb if (!collection.Any(i => <condition>)) { }
ifall if (collection.All(i => <condition>))
ifallb if (collection.All(i => <condition>)) { }
ifxall if (!collection.All(i => <condition>))
ifxallb if (!collection.All(i => <condition>)) { }
cany collection.Any() ? true : false
canyc collection.Any(i => <condition>) ? true : false
cxany !collection.Any() ? true : false
cxanyc !collection.Any(i => <condition>) ? true : false
call collection.All(i => <condition>) ? true : false
cxall !collection.All(i => <condition>) ? true : false

Collection check snippets by Length and Count properties with null check

Shortcut Generated Code
ifcgz if (collection?.Count > 0)
ifcgzb if (collection?.Count > 0) { }
ifcez if (collection?.Count is null or 0)
ifcezb if (collection?.Count is null or 0) { }
iflgz if (collection?.Length > 0)
iflgzb if (collection?.Length > 0) { }
iflez if (collection?.Length is null or 0)
iflezb if (collection?.Length is null or 0) { }
ccgz collection?.Count > 0 ? true : false
ccez collection?.Count is null or 0 ? true : false
clgz collection?.Length > 0 ? true : false
clez collection?.Length is null or 0 ? true : false

Javascript

There are snippets for bootstrap classes justify-content, align-items, align-self

Shortcut Generated Code
jcs justify-content-start
jcc justify-content-center
jce justify-content-end
jcb justify-content-between
jca justify-content-around
ais align-items-start
aic align-items-center
aie align-items-end
aisch align-items-stretch
ass align-self-start
asc align-self-center
ase align-self-end
assch align-self-stretch

usnippetpack's People

Contributors

za9cser avatar

Watchers

 avatar

usnippetpack's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.