Skip to content

Instantly share code, notes, and snippets.

View mikoskinen's full-sized avatar

Mikael Koskinen mikoskinen

View GitHub Profile
@mikoskinen
mikoskinen / Windows Phone storage tests
Last active August 29, 2015 13:56
Windows Phone storage, testing thread safety with Isolated Storage.
The code which writes a file using Isolated Storage:
private void CreateNewFileUsingIsolatedStorage(string filePath)
{
using (var myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var fileStream = myIsolatedStorage.OpenFile(filePath, FileMode.Create, FileAccess.Write))
{
using (var writer = new StreamWriter(fileStream))
{
@mikoskinen
mikoskinen / gist:935608835f27e6d8ecbe63483709ddf1
Created February 18, 2017 10:33
Simple Event Aggegator for Multi Window communication in UWP
public interface ISubscriber<in TMessage>
{
void HandleMessage(TMessage message);
}
public class MyEventAggregator
{
private static List<Tuple<CoreDispatcher, object>> subscribers = new List<Tuple<CoreDispatcher, object>>();
public void Subscribe<TMessage>(ISubscriber<TMessage> subscriber)
@mikoskinen
mikoskinen / NCompileBench Results.txt
Last active May 22, 2020 17:55
NCompileBench example results
AMD Ryzen 9 3950X ## 2256 ## 813
Surface Go 2 (m3-8100Y) ## 785 ## 565
[{
"BenchmarkDate": "2020-05-25T04:33:57.9189754+00:00",
"HardwareInfo": {
"SystemFamily": "To be filled by O.E.M.",
"SystemSku": "To be filled by O.E.M.",
"Manufacturer": "Micro-Star International Co., Ltd.",
"Model": "MS-7B85",
"OS": {
"Name": "Microsoft Windows 10 Enterprise",
"Version": "10.0.19041",