Skip to content

Instantly share code, notes, and snippets.

@evilpilaf
evilpilaf / cleanup-bin.ps1
Created November 7, 2023 13:01
Remove all bin and obj folders recursively
gci -include bin,obj -recurse | remove-item -force -recurse
# Deletes all the bin and obj folders under a path, used to clean the root path for all my dotnet projects
# Taken from https://stackoverflow.com/a/5924807/1422608
Get-ChildItem .\ -include bin,obj -Recurse | ForEach-Object ($_) { Remove-Item $_.FullName -Force -Recurse }
public MemoryStream MergeAsAnimation(IReadOnlyList<MemoryStream> images, ImageParametersBase imageParameters)
{
var memoryStream = new MemoryStream();
var encoderOptions = new SkGifEncoderOptions { RepeatCount = 0 };
using var encoder = new SkGifEncoder(memoryStream, encoderOptions);
foreach (var imageStream in images)
{
imageStream.Position = 0;
Get-ChildItem "{Path}" -Recurse -File | Where CreationTime -lt (Get-Date).AddDays(-{days}) | Remove-Item -Force
@evilpilaf
evilpilaf / init.ts
Last active June 27, 2022 15:07
vscode setup
import * as vscode from 'vscode';
import { initUsePackage, usePackage, configSet } from 'vscode-use-package';
import * as js from './js';
export function init(context: vscode.ExtensionContext) {
initUsePackage(context);
configSet('workbench', {
'editor.showTabs': true,
@evilpilaf
evilpilaf / gitconfig alias
Last active January 19, 2023 08:47
Alias for git commands
[core]
editor = \"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" fileeditor
autocrlf = true
longpaths = true
commitGraph = true
[i18n]
filesEncoding = utf-8
[user]

Keybase proof

I hereby claim:

  • I am evilpilaf on github.
  • I am evilpilaf (https://keybase.io/evilpilaf) on keybase.
  • I have a public key ASDc7shRKfJiDUZlMcasaAE8WKC7YCx-MNjVxbbmgczoAgo

To claim this, I am signing this object:

@evilpilaf
evilpilaf / print-binding-redirects.ps1
Created July 6, 2018 09:39 — forked from dburriss/print-binding-redirects.ps1
Print out the binding redirects in a bin folder. Run from the build output directory.
function Find-Dlls() {
$dlls = Get-ChildItem | ? { $_.Extension -eq '.dll' } | % { [System.Reflection.AssemblyName]::GetAssemblyName($_.FullName).FullName }
return $dlls
}
function Set-Bindings() {
$binding = "<dependentAssembly>
<assemblyIdentity name=`"{0}`" publicKeyToken=`"{2}`" culture=`"neutral`" />
<bindingRedirect oldVersion=`"0.0.0.0-{1}`" newVersion=`"{1}`" />
@evilpilaf
evilpilaf / gist:e2ff045cb0dae41dc3126968424b7e95
Created February 16, 2018 18:29 — forked from bradwilson/.gitconfig
~/.config/git/config
[user]
name = Brad Wilson
email = dotnetguy@gmail.com
signingkey = 0B7BD15AD1EC5FDE
[alias]
a = add -A
abort = rebase --abort
amend = commit --amend -C HEAD
blame = blame -w -M -C
br = branch