Skip to content

Instantly share code, notes, and snippets.

View DanielMPries's full-sized avatar

Dan Pries DanielMPries

  • Buffalo, NY
View GitHub Profile
@DanielMPries
DanielMPries / .editorconfig
Created December 27, 2018 03:04
Personal C# .editorconfig
# http://EditorConfig.org
###############################
# Common Settings #
###############################
# This file is the top-most EditorConfig file
root = true
# All Files
@DanielMPries
DanielMPries / zip-folders.ps1
Created October 3, 2018 19:11
Compress all of the files in a given path
# This is the old way, use Compress-Archive
Add-Type -assembly "system.io.compression.filesystem"
$source = Get-ChildItem -Path "c:\stuff" -Directory
Write-Host "$($source.length) files found"
Foreach ($s in $source) {
Write-Host "Writing $($s.name).zip..."
$destination = Join-path -path "C:\stuff" -ChildPath "$($s.name).zip"
If(Test-path $destination) {
Remove-item $destination
}
@DanielMPries
DanielMPries / WithObjectExtenension.cs
Last active October 22, 2017 00:55
Demonstrates the With keyword implementation similar to VB.NET using a generic extension method
using System;
namespace Sandbox {
class Program {
static void Main(string[] args) {
var someLongNamedVariableName = new Person();
// Notice that the parent object is marked with two underscores "__"
// and the child with a single underscore "_". This is because the
// double underscore created in the outer anonymous Action lamda