Skip to content

Instantly share code, notes, and snippets.

View ddieppa's full-sized avatar
🏠
Working from home

Daniel Dieppa ddieppa

🏠
Working from home
View GitHub Profile

IEnumerable

IEnumerable vs IReadOnlyList

That’s by the way also true for IEnumerable itself. This interface provides only the basic functionality for working with collections (really, just iterating through them), and so if your method requires more than that, also state that requirement up front. For example, if the only thing you need out of a collection is the capability to enumerate its elements, it’s fine to use IEnumerable:

public void SomeMethod(IEnumerable<string> collection)
{
    foreach (string element in collection)
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"segments": [
{
"type": "shell",
"style": "plain",
@ddieppa
ddieppa / Microsoft.PowerShell_profile.ps1
Last active March 26, 2025 12:28
OhMyPosh Configuration and PowerShell Profile
# Handle PowerShell 7.4+ UTF-8 encoding issues
$previousOutputEncoding = [Console]::OutputEncoding
[Console]::OutputEncoding = [Text.Encoding]::UTF8
try {
# # PowerToys Command Not Found Integration (with safe handling)
# $powerToysModulePath = Join-Path $env:LocalAppData "PowerToys\WinGetCommandNotFound.psd1"
# if (Test-Path $powerToysModulePath) {
# try {
# # Enable PowerShell Experimental Features for PowerToys
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@benmccallum
benmccallum / GraphQLSchemaTests.cs
Last active August 26, 2021 10:21
Verify your GraphQL schema changes
using System.Net;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Testing;
using Snapshooter.Json;
using Xunit;
namespace MyCompany.MyService
{
public class GraphQLSchemaTests
: IClassFixture<WebApplicationFactory<Startup>>
@PascalSenn
PascalSenn / MultipartRequestMiddleware
Last active April 7, 2024 20:27
MultiPartRquestMiddlware made with ❤️ by https://github.com/acelot
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Text.Json;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"copyOnSelect": false,
"defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings":
[
// Copy and paste are bound to Ctrl+Shift+C and Ctrl+Shift+V in your defaults.json.
@philippdolder
philippdolder / Setup-Windows-Defender-Exclusions-Rider.ps1
Created January 6, 2020 00:48
Windows Defender configuration for JetBrains Rider
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[string]
$RiderHome
)
function Update-WindowsDefenderForRider {
[CmdletBinding()]
param (
@ryanhanwu
ryanhanwu / Brewfile
Last active October 10, 2024 00:19
New Mac Setup Script 2021
# Taps
tap 'homebrew/cask-fonts'
tap 'homebrew/cask-versions'
tap 'heroku/brew'
# Install CLI Tools
## Shell Utilities
brew 'coreutils'
brew 'findutils'
brew 'autojump'

Windows Setup Notes

based on original document from Alan Stevens

Installation

IMPORTANT:

  • Install using Local Account first, attach Microsoft account later