Solving tech problems

Allow preview-only file with expiration date in One Drive

Uncategorized

So… The task is to allow someone to preview any file from your One Drive, but you want also to set some expiration date, so after that date this file will be inaccessible. Open your One Drive app (or go to the online version) and select any file. After the selection, you have at the top command Share – click on it and you will get something like this: First, you want to allow only preview, so click on Any with the link can edit and change it to Can…read more

How to Restore a USB drive using Diskpart

Uncategorized

Open a command Prompt as administrator (cmd.exe) Type Diskpart then press Enter Type List Disk then press Enter Type Select Disk X (where X is the disk number of your USB drive) then press Enter Type Clean then press Enter Type Create Partition Primary then press Enter Type Format fs=Fat32 Quick then press Enter (You can also use NTFS or exFAT) Type Active then press Enter Type Exit then press Enter

Visual Studio RESX files comparer

Uncategorized

When you do localization in Visual Studio you need a tool to check which labels are not translated in other languages and to generally overview translations. This is a good VS exstension: https://github.com/tom-englert/ResXResourceManager/wiki/Usage

Localization in ASP.NET Core

Uncategorized

The default providers are: QueryStringRequestCultureProvider CookieRequestCultureProvider AcceptLanguageHeaderRequestCultureProvider Most likely the culture is determined from the Accept-Language HTTP header that the browser is sending. In Startup.cs put this fro Slovenian: and in Configure method just use app.UseRequestLocalization(); before app.UseMvc();

ASP.NET Core 3.1 Identity tables in MySQL

Uncategorized

To have identity tables in MySQL install Pomelo package, set the connection string and DBContext in Startup.cs like this: services.AddDbContext(options => options.UseMySql(Configuration.GetConnectionString(“MySqlConnection”)); Open NuGet > Package Manager ConsoleRun: EntityFrameworkCore\Update-Database -VerboseRun: update-database

XPATH cheatsheet

Uncategorized

This post was inspired by great this find, which I managed to search while working on one project. It happens few times in the past that some interested content was not available any more and in order to save this great cheatsheet I am copying it from LeCoupa