This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct GameMetricsView: View { | |
@Environment(\.colorScheme) var colorScheme | |
var gameMode: String | |
var totalPlays: Int | |
@Binding var totalAverage: Double | |
@State private var animatedTotalAverage: Double = 0.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ConfettiView.swift | |
// Glosify | |
// | |
// Created by Mikael Deurell on 2023-07-21. | |
// | |
import Foundation | |
import SwiftUI |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BasicUpstart2(start) | |
* = $1000 | |
start: | |
sei | |
lda #$7f | |
sta $dc0d | |
sta $dd0d | |
lda #$01 | |
sta $d01a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
std::wstring StringConverter::StringToWideString(const std::string& s) { | |
int len = MultiByteToWideChar(CP_UTF8, 0, s.c_str(), s.length(), NULL, 0); | |
std::wstring ws(L"", len); | |
wchar_t* pWSBuf = const_cast<wchar_t*>(ws.c_str()); | |
MultiByteToWideChar(CP_UTF8, 0, s.c_str(), -1, pWSBuf, len); | |
return ws; | |
} | |
std::string StringConverter::WideStringToString(const std::wstring& ws) { | |
int len = WideCharToMultiByte(CP_UTF8, 0, ws.c_str(), ws.length(), 0, 0, NULL, NULL); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# project file conversion utility | |
param ( | |
[string]$folderPath = $(throw "-folderPath is required.") | |
) | |
$allProjectFiles = get-childitem -path $folderPath -Filter *.vcxproj -Recurse | |
foreach ($projectFile in $allProjectFiles){ | |
$projectFileContent = get-content $projectFile.FullName | |
$projectFileContent | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static IReadOnlyCollection<TItem> GetAllItems<TItem>(this IViewStorageReader viewStorage, string keyForListOfKeys, Logger logger, string typeOfItems, uint batchSize = 200) | |
where TItem : class | |
{ | |
return GetAllItems<TItem, IEnumerable<string>>(viewStorage, keyForListOfKeys, logger, l => l.ToList(), typeOfItems, batchSize: batchSize); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fire command and validate mediator | |
[Test(Description = "Executing DisplayArticlesViewCommand sends message with products articles [Mikael Deurell]")] | |
public void Executing_DisplayArticlesViewCommand_SendsDisplayArticleViewListWithProvidedArticles() | |
{ | |
// Given the user wants to display selected articles in a dialogue view | |
var sut = | |
new ProductViewModel(new Product("1", "desc", ProductType.Assortment, "10", "10", _dummyArticles, null, | |
0)); | |
int notify = 0; | |
ObservableCollection<ArticleViewModel> articlesReceived = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fire Command | |
[Test(Description = "Added product shows up in repository with correct savestate")] | |
public void ExecutingCreateProductCommand_WithNewProduct_ShowsUpInRepository() | |
{ | |
// Given the user wants to create a new product on the Create Product View | |
var product = new Product("4242", "desc", ProductType.Assortment, "201001", "123", _dummyArticles, null, | |
1); | |
// When the user clicks the New button a CreateProductCommand is fired on the ViewModel | |
var viewModel = new ProductViewModel(product); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Validate fired event | |
[Test(Description = "Verify that prop changed fires [Mikael Deurell]")] | |
public void Description_Changed_FiresPropertyChanged() | |
{ | |
// Given the user wants to change the product description on a Product | |
int notify = 0; | |
var sut = new ProductViewModel(); | |
sut.PropertyChanged += (sender, e) => | |
{ | |
if (e.PropertyName.Equals("Description")) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<UserControl x:Class="ColourLab.IndividualColourView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="controlRoot"> | |
<StackPanel> | |
<StackPanel.Triggers> | |
<EventTrigger RoutedEvent="StackPanel.MouseEnter"> | |
<BeginStoryboard Name="GoUp" HandoffBehavior="Compose"> | |
<Storyboard> | |
<Int32Animation Storyboard.TargetName="controlRoot" Storyboard.TargetProperty="ColourWidth" To="100" Duration="0:0:0.6" | |
AccelerationRatio="0.1" DecelerationRatio="0.9" /> | |
</Storyboard> | |
</BeginStoryboard> |
NewerOlder