Install and secure MySql isntallation:
apt install mariadb-server
mysql_secure_installation
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Windows.Threading; | |
namespace MvvmFramework | |
{ | |
public static class AsyncHelper | |
{ | |
private static readonly TaskFactory TaskFactory = new |
// BEWARE: There is no universal way to synchronously wait for async tasks. This can be used in a WPF context only. | |
private static void RunSynchronously(Func<Task> func) | |
{ | |
// Gets the awaiter for the task | |
var awaiter = func().ConfigureAwait(false).GetAwaiter(); | |
// Creates a new dispatcher frame that will lock (like Window.ShowDialog()) but with the message pump still running | |
// The dispatcher frame terminates only when the task to wait for has completed | |
DispatcherFrame frame = new DispatcherFrame(); |
import { Http, ResponseContentType } from '@angular/http'; | |
... | |
constructor( | |
private http: Http, | |
) { } | |
downloadFile() { | |
return this.http | |
.get('https://jslim.net/path/to/file/download', { |
const languages = ['en', 'fr']; | |
this.translateService.addLangs(languages); | |
for (const lang of languages) { | |
this.translateService.setTranslation(lang, require('../assets/i18n/' + lang + '.json')); | |
} | |
// Set this after 'setTranslation' to avoid unnecessary XHR request | |
this.translateService.setDefaultLang('en'); |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Microsoft.AspNetCore.Authorization; | |
namespace DamienBraillard.AspNetCoreSimpleRoleAuthorization | |
{ | |
/// <summary> | |
/// Defines the base functionality of the class used to provide applicative roles for a user when using the simple role | |
/// authorization. | |
/// </summary> |
On windows: