This file contains 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
using System.Text.Json; | |
namespace TODO; | |
class Samples | |
{ | |
public static void IntegerListMatch() | |
{ | |
List<List<int>> list = |
This file contains 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
function expandToolSectionAccordionItem() { | |
let collapseElement = document.getElementById('collapseTools'); | |
if (collapseElement) { | |
let bsCollapse = new bootstrap.Collapse(collapseElement, { | |
toggle: true | |
}); | |
} | |
} |
This file contains 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
function expandAll() { | |
document.querySelectorAll('.accordion-collapse').forEach(item => { | |
let bsCollapse = new bootstrap.Collapse(item, { toggle: false }); | |
bsCollapse.show(); | |
}); | |
} | |
function collapseAll() { | |
document.querySelectorAll('.accordion-collapse').forEach(item => { | |
let bsCollapse = new bootstrap.Collapse(item, { toggle: false }); |
This file contains 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
string DefaultInterpolatedStringHandler() | |
{ | |
var title = "Mr."; | |
var firstName = "John"; | |
var middleName = "Q."; | |
var lastName = "Doe"; | |
DefaultInterpolatedStringHandler stringHandler = new(50, 4); | |
stringHandler.AppendLiteral("Hello "); | |
stringHandler.AppendFormatted(title); | |
stringHandler.AppendLiteral(" "); |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Bootstrap scrollable modal</title> | |
<link href="Lib/bootstrap/dist/css/bootstrap.css" rel="stylesheet" /> | |
<!-- REQUIRED --> | |
<script src="Lib/bootstrap/js/bootstrap.bundle.min.js"></script> |
This file contains 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
using Spectre.Console; | |
namespace SpectreExceptionsLibrary; | |
/// <summary> | |
/// Custom setting for presenting runtime exceptions using AnsiConsole.WriteException. | |
/// | |
/// The idea here is to present different types of exceptions with different colors while | |
/// one would be for all exceptions and the other(s) for specific exception types. | |
/// </summary> |
This file contains 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
using System.Text.Json; | |
namespace SomeLibrary.Classes; | |
/// <summary> | |
/// Provides utility methods for validating the presence of specific sections | |
/// in the "appsettings.json" configuration file. | |
/// </summary> | |
/// <remarks> | |
/// This class is designed to assist in ensuring that critical configuration | |
/// sections, such as "EntityConfiguration" and "ConnectionStrings", are |
This file contains 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 class Extensions | |
{ | |
/// <summary> | |
/// Joins the elements of the specified <see cref="IEnumerable{T}"/> into a single string, | |
/// separating them with the specified separator, and appending a specified token before the last element. | |
/// </summary> | |
/// <typeparam name="T">The type of the elements in the collection.</typeparam> | |
/// <param name="sender">The collection of elements to join.</param> | |
/// <param name="separator"> | |
/// The string to use as a separator between elements. Defaults to ", " if not specified. |
This file contains 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
internal class DataOperations | |
{ | |
public static IEnumerable<Customer> GetCustomerDetails() | |
{ | |
using IDbConnection connection = new SqlConnection(DataConnections.Instance.MainConnection); | |
var customerDictionary = new Dictionary<int, Customer>(); | |
var customers = connection.Query<Customer, Contact, Country, ContactType, Customer>( | |
SqlStatements.CustomerWithContacts(), |
This file contains 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
using System.Numerics; | |
namespace Extensions; | |
public static class GenericINumberExtensions | |
{ | |
public static T[] Merge<T>(this T[] container, T[] T1) where T : INumber<T> | |
=> [.. container, .. T1]; | |
public static T[] Merge<T>(this T[] container, T[] T1, T[] T2) where T : INumber<T> |
NewerOlder