Skip to content

Instantly share code, notes, and snippets.

View VaclavElias's full-sized avatar
🎯
Focusing

Vaclav Elias VaclavElias

🎯
Focusing
View GitHub Profile
@VaclavElias
VaclavElias / Instructions.md
Last active April 2, 2023 13:03
Stack Exchange and Discord Integration

Yes, you can set up a notification system to push new entries and comments tagged with 'stride' from Stack Exchange to your Discord channel. One way to achieve this is by using a webhook combined with an RSS feed from Stack Exchange.

Follow these steps to set up the notification system:

Create a webhook in your Discord channel:

  1. Go to your Discord server settings.
  2. Click on "Integrations" and then click "Create Webhook."
  3. Customize the webhook's name, avatar, and choose the desired channel for notifications.
  4. Copy the webhook URL, as you'll need it in the next steps.
var startTime = new DateTime(2022, 4, 11, 8, 0, 0);
var endTime = new DateTime(2022, 4, 11, 17, 0, 0);
var breaks = new List<(DateTime Start, DateTime End)>
{
(new DateTime(2022, 4, 11, 12, 0, 0), new DateTime(2022, 4, 11, 13, 0, 0)),
(new DateTime(2022, 4, 11, 15, 0, 0), new DateTime(2022, 4, 11, 15, 30, 0))
};
// Validate breaks, merge them if needed
@VaclavElias
VaclavElias / Stride-Code-Only-Preview-4.md
Last active January 15, 2022 20:48
Stride Code Only Preview 4

Review 4

Feedback from @Eideren and @manio143.

Thanks for your feedback. I think your feedback can be merged together. Note again, that the naming convention can be changed to anything appropriate at the later stage.

If I forgot to address anything you mentioned previously, please feel free to mention that again. Once our thoughts are more stable. I will ping all others who expressed interest in the code-only approach.

https://github.com/VaclavElias/Stride3DTutorials/tree/main/Other/Minimal https://github.com/VaclavElias/stride/tree/code-only

@VaclavElias
VaclavElias / ConvertAllvsSelectBenchmark.cs
Last active July 5, 2023 08:49
List - ConvertAll vs Select Benchmark
using BenchmarkDotNet.Attributes;
namespace Benchmark.Tests
{
[MemoryDiagnoser]
public class ConvertAllvsSelectBenchmark
{
[Params(10, 100)]
public int Iterations { get; set; }
routes.MapRoute(
name: "catch-all",
template: "{*url:regex(^(?!(.*.map)).*$)}",
defaults: new { Controller = "Page", Action = "Index" }
//constraints: new { url = @".*\.js.map" }
);
@VaclavElias
VaclavElias / Startup.cs.md
Created September 17, 2018 14:09
Negative Constrain in MapRoute
 routes.MapRoute(
                    name: "catch-all",
                    template: "{*url:regex(^(?!(.*.map)).*$)}",
                    defaults: new { Controller = "Page", Action = "Index" }
                    //constraints: new { url = @".*\.js.map" }
                    );
@VaclavElias
VaclavElias / SQL-Calendar-Table-UK.md
Last active September 13, 2018 17:51
SQL Calendar Table UK
DECLARE @StartDate DATE = '20100101', @NumberOfYears INT = 20;

-- prevent set or regional settings from interfering with 
-- interpretation of dates / literals

SET DATEFIRST 1; -- this seems not working, used CASE for DayOf Week
SET DATEFORMAT dmy;
SET LANGUAGE British;
@VaclavElias
VaclavElias / AzureSql.md
Last active June 21, 2018 16:33
Get Latest SQL Queries

Excluded some rubbish.

SELECT [Time], [Query] FROM
(SELECT deqs.last_execution_time AS [Time], dest.text AS [Query]
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest) a
WHERE [Query] NOT LIKE '%execution_count%'
AND [Query] NOT LIKE '%last_execution%'
AND [Query] NOT LIKE '%firewall_rules_table%'
@VaclavElias
VaclavElias / Aspnet.core2.1andAngular5.md
Last active May 19, 2018 18:41
ASP.NET Core 2.1 Preview + Angular 5 in MVC Razor Pages

This below is now outdated, follow this https://gist.github.com/VaclavElias/544b8d097981e217ae0dc7c32adba705

ASP.NET Core 2.1 Preview + Angular 5 in MVC Razor Pages

  • I think there are many unnecessary steps in this guide, lots of mess
  • Any updates in Angular, you have to run webpack to compile all.
  • Update 25/04/2018 - I have got now better version which I will add on a separate link, some steps will be removed (e.g. ng eject --force)
  1. Project 1 - I have installed ASP.NET Core 2.1 Preview2 Angular and updated Angular 5 to the latest
  2. Project 2 - I have installed ASP.NET Core 2.1 Preview2 MVC with Authentication