|
Παρουσίαση με Ετικέτες
Όλες οι Ετικέτε... » Snippets (RSS)
-
One thing I tend to forget is how powerful azure cli is and how many things can be done way faster through this tool. So, for example, if you want to delete all files in an Azure Storage Account at once, a fast and easy way to do just that is by using the delete-batch command from Azure CLI. Run...
|
-
One thing I tend to forget is how powerful azure cli is and how many things can be done way faster through this tool. So, for example, if you want to delete all files in an Azure Storage Account at once, a fast and easy way to do just that is by using the delete-batch command from Azure CLI. Run...
|
-
IEx is Elixir’s interactive shell, where you can type any Elixir expressions and get its result. One issue you might come across when trying to use iex in Powershell, through a command e.g. iex -S mix, you might get the following error: [crayon-589dd336d7efc799259712/] The problem is that iex is an alias in Powershell, for Invoke-Expression [crayon-589dd336d7f0c258832537/] Solution To overcome this problem you simply use iex.bat...
|
-
If you have multiple files having an extension like jpeg and you want to batch rename them to jpg as extension you can do that with a single line of code: [crayon-585288c33f2cb046844413/] In my case I wanted to batch rename all my template files from .jade to .pug, as there was an issue with trademarks, so the command would change to: [crayon-585288c33f2dc867062097/]
|
-
It might come time where you need to alter your database to use a different collation. You can do this using the following snippet: [crayon-58480392872f2119297576/] When you execute the above snippet you may come to the following error: This error occurs when your database in Multi-User mode where users are accessing the database or there are objects referring to your database. To overcome this error,...
|
-
To get a rough view of how many rows, total, used and unused space each table has, in a sql server database you can run the following query: [crayon-583450f43d6a5734372322/] Another way is using the stored procedure sp_spaceused which displays the number of rows, disk space reserved, and disk space used by a table, indexed view, or Service Broker queue in...
|
-
Sometimes you may need to render a certain view as string, for example when you want to send an email where usually the body is pure html. To do so, you need to create a service that takes two arguments: the first one is a string representing the path to the view you want to render; the second one is an object that is used from...
|
-
NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers. In order to install a package, you can do it either through Nuget Package Manager UI or through Package Manager Console using: [crayon-57a8afebcd7a1304461554/] In case...
|
-
A custom validation attribute allows you to create metadata, that you can use in the data model to validate data fields. In order to validate when a collection is null or empty, you may create a custom validation attribute, which returns false in case the object is null or empty. [crayon-56d4b8aa38fbd868986865/] You can now decorate classes using this attribute, i.e.: [crayon-56d4b8aa38ff3854591558/] Let’s assume that you have a WebAPI method test/validation, which:...
|
-
In order to sort a collection of objects based on another list that contains the proper order, we can create an extension method that performs a Join between these two collections and pass a func as innerKeySelector argument to allow us to sort this collection based on whatever key we want. Example [crayon-56b287338aceb734717922/]
|
-
-
[crayon-56b287338b407356608560/]
|
|
|
|