Snippset

Snippset Feed

Windows by Burton
...see more

After enabling Stereo Mix, configure your playback devices:

  1. In the Playback tab of the Sound Control Panel, right-click your primary audio device and select Properties.
  2. Navigate to the Listen tab.
  3. Check the box labeled Listen to this device.
  4. From the dropdown menu, select Stereo Mix as the playback device.
  5. Click Apply to confirm the changes.

This configuration routes audio through both selected devices simultaneously.

.NET by Jerry
...see more

C#'s async/await pattern simplifies asynchronous programming, but integrating it into console applications poses a challenge. The traditional static void Main() method can't be marked as async, leading to compiler errors when attempting to use await directly.

Workaround Strategies:

  • Separate Async Method: Encapsulate asynchronous operations within a separate method marked as async. Then, invoke this method from Main() using .GetAwaiter().GetResult() to execute it synchronously. This approach ensures exceptions are unwrapped properly, avoiding the AggregateException that occurs with .Result or .Wait().

  • Async Main (C# 7.1 and Later): Starting with C# 7.1, you can define the entry point as static async Task Main(), allowing the use of await directly within Main(). This modernizes the approach and simplifies asynchronous code execution in console applications.

For a detailed explanation and code examples see Async/await in a console application.

...see more

Summary:
This video demonstrates how to generate a TreeView structure using data directly from a SQL Server database in an MVC 4 application. The example uses recursive methods to fetch hierarchical data from a parent-child table (such as a category structure). The TreeView is rendered using a combination of Razor and recursive HTML helpers.

Key Steps:

  • Create a SQL table with ID and ParentID fields.
  • Use Entity Framework to fetch data into a recursive model.
  • Write recursive logic in the controller to build the tree.
  • Use a partial view or helper method to render nested HTML in the view.

Best For:
Developers working with older ASP.NET MVC versions who need to generate TreeViews from database-driven content, particularly with dynamic data structures.

...see more

Summary:
This tutorial walks through building a TreeView in ASP.NET Core using ViewModel binding and JSON serialization. The TreeView is rendered on the client side using a simple recursive HTML structure. The backend constructs the hierarchy from a static or database source and passes it to the view. The data is structured using parent-child relationships, and the final JSON is passed to the view for rendering. No third-party libraries are used, making it a lightweight and transparent solution.

Key Steps:

  • Define a hierarchical ViewModel with recursive child collections.
  • Populate the ViewModel with data (manually or from a database).
  • Serialize the structure into JSON.
  • Render the TreeView in a Razor view using JavaScript.

Best For:
Developers using ASP.NET Core who want a lightweight, client-side rendered TreeView without relying on jQuery plugins or third-party UI components.

...see more

TreeView is a popular UI component used for displaying hierarchical data in a nested, expandable structure. In ASP.NET MVC and ASP.NET Core, creating a TreeView can enhance navigation, represent parent-child relationships (such as categories or folders), and improve user interaction with complex data structures.

This overview introduces how TreeViews are implemented in both ASP.NET MVC 4 and ASP.NET Core, using Razor views and model binding, and how data from a database can be dynamically rendered in a hierarchical format.

...see more

jsTree is a lightweight jQuery plugin that enables the creation of interactive tree views within web applications. It supports themes, drag-and-drop, keyboard navigation, and various data formats including JSON and HTML. Developers can extend it with plugins for checkboxes, search, context menus, and more.

Key features include:

  • JSON and HTML data support
  • Drag-and-drop functionality
  • Highly customizable themes
  • Plugin architecture
  • Accessibility and keyboard support

jsTree is well-suited for projects that still leverage jQuery and need quick integration of hierarchical navigation or selection UIs.

Windows by Burton
...see more

To play audio through two devices at once, enable the "Stereo Mix" feature:

  1. Right-click the speaker icon in the taskbar and select Open Sound settings.
  2. Scroll down and click on More sound settings under the Advanced section.
  3. In the Recording tab, right-click and select Show Disabled Devices.
  4. Right-click on Stereo Mix and choose Enable.
  5. Set Stereo Mix as the default recording device by right-clicking it and selecting Set as Default Device.

This setup allows audio to be duplicated across multiple output devices.

React by Riley
...see more

JavaScript Date objects are always created and manipulated relative to the user’s local timezone, which it gets from the environment.

const date = new Date("2025-05-27T20:03:00Z"); // stored as UTC
console.log(date.toString());
// → "Tue May 27 2025 22:03:00 GMT+0200 (Central European Summer Time)"

To determine the client’s timezone:

Intl.DateTimeFormat().resolvedOptions().timeZone
// → "Europe/Berlin" or similar

This automatic timezone handling is key to understanding how UTC inputs appear offset when viewed or edited on the frontend.

...see more

A thoughtful reflection on life’s most valuable lessons learned over time. These insights emphasize protecting your energy, living authentically, and focusing on what truly matters.

Top 10 Lessons:

  1. Protect your energy—it is your most valuable resource.
  2. Say yes to fewer commitments but invest fully in them.
  3. Self-awareness is the foundation of meaningful growth.
  4. Live your truth without waiting for approval.
  5. Release what no longer supports your development.
  6. Trust actions more than words.
  7. Prioritize inner peace over winning arguments.
  8. Surround yourself with people who inspire and challenge you.
  9. Growth often begins by embracing discomfort.
  10. Celebrate progress instead of chasing perfection.PatrikPatrik
Add to Set
  • .NET
  • Agile
  • AI
  • ASP.NET Core
  • Azure
  • C#
  • Cloud Computing
  • CSS
  • EF Core
  • HTML
  • JavaScript
  • Microsoft Entra
  • PowerShell
  • Quotes
  • React
  • Security
  • Software Development
  • SQL References
  • Technologies
  • Testing
  • Visual Studio
  • Windows